Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
472f13f0
Commit
472f13f0
authored
Nov 27, 2012
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow change of 'requested_state'
parent
00de2d1b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
slapos/proxy/schema.sql
slapos/proxy/schema.sql
+3
-2
slapos/proxy/views.py
slapos/proxy/views.py
+6
-1
No files found.
slapos/proxy/schema.sql
View file @
472f13f0
--version:
9
--version:
10
CREATE
TABLE
IF
NOT
EXISTS
software
%
(
version
)
s
(
url
VARCHAR
(
255
)
UNIQUE
);
CREATE
TABLE
IF
NOT
EXISTS
software
%
(
version
)
s
(
url
VARCHAR
(
255
)
UNIQUE
);
CREATE
TABLE
IF
NOT
EXISTS
computer
%
(
version
)
s
(
CREATE
TABLE
IF
NOT
EXISTS
computer
%
(
version
)
s
(
address
VARCHAR
(
255
),
address
VARCHAR
(
255
),
...
@@ -14,7 +14,8 @@ CREATE TABLE IF NOT EXISTS partition%(version)s (
...
@@ -14,7 +14,8 @@ CREATE TABLE IF NOT EXISTS partition%(version)s (
slave_instance_list
TEXT
,
slave_instance_list
TEXT
,
software_type
VARCHAR
(
255
),
software_type
VARCHAR
(
255
),
partition_reference
VARCHAR
(
255
),
partition_reference
VARCHAR
(
255
),
requested_by
VARCHAR
(
255
)
requested_by
VARCHAR
(
255
),
requested_state
VARCHAR
(
255
)
NOT
NULL
DEFAULT
'started'
);
);
CREATE
TABLE
IF
NOT
EXISTS
slave
%
(
version
)
s
(
CREATE
TABLE
IF
NOT
EXISTS
slave
%
(
version
)
s
(
...
...
slapos/proxy/views.py
View file @
472f13f0
...
@@ -78,7 +78,7 @@ def partitiondict2partition(partition):
...
@@ -78,7 +78,7 @@ def partitiondict2partition(partition):
if
partition
[
'software_release'
]:
if
partition
[
'software_release'
]:
slap_partition
.
_need_modification
=
1
slap_partition
.
_need_modification
=
1
slap_partition
.
_requested_state
=
'started'
slap_partition
.
_requested_state
=
partition
[
'requested_state'
]
slap_partition
.
_parameter_dict
=
xml2dict
(
partition
[
'xml'
])
slap_partition
.
_parameter_dict
=
xml2dict
(
partition
[
'xml'
])
address_list
=
[]
address_list
=
[]
for
address
in
execute_db
(
'partition_network'
,
for
address
in
execute_db
(
'partition_network'
,
...
@@ -290,6 +290,7 @@ def request_not_shared():
...
@@ -290,6 +290,7 @@ def request_not_shared():
partition_reference
=
request
.
form
.
get
(
'partition_reference'
,
''
).
encode
()
partition_reference
=
request
.
form
.
get
(
'partition_reference'
,
''
).
encode
()
partition_id
=
request
.
form
.
get
(
'computer_partition_id'
,
''
).
encode
()
partition_id
=
request
.
form
.
get
(
'computer_partition_id'
,
''
).
encode
()
partition_parameter_kw
=
request
.
form
.
get
(
'partition_parameter_xml'
,
None
)
partition_parameter_kw
=
request
.
form
.
get
(
'partition_parameter_xml'
,
None
)
requested_state
=
xml_marshaller
.
xml_marshaller
.
loads
(
request
.
form
.
get
(
'state'
))
if
partition_parameter_kw
:
if
partition_parameter_kw
:
partition_parameter_kw
=
xml_marshaller
.
xml_marshaller
.
loads
(
partition_parameter_kw
=
xml_marshaller
.
xml_marshaller
.
loads
(
partition_parameter_kw
.
encode
())
partition_parameter_kw
.
encode
())
...
@@ -315,6 +316,10 @@ def request_not_shared():
...
@@ -315,6 +316,10 @@ def request_not_shared():
a
=
args
.
append
a
=
args
.
append
q
=
'UPDATE %s SET slap_state="busy"'
q
=
'UPDATE %s SET slap_state="busy"'
if
requested_state
:
q
+=
', requested_state=?'
a
(
requested_state
)
# If partition doesn't exist: create it and insert parameters
# If partition doesn't exist: create it and insert parameters
if
partition
is
None
:
if
partition
is
None
:
partition
=
execute_db
(
'partition'
,
partition
=
execute_db
(
'partition'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment