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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
slapos.core
Commits
317d5c8e
Commit
317d5c8e
authored
Oct 02, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update slapproxy behavior: when instance already exist, only update partition_parameter_kw
parent
4136056d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
13 deletions
+19
-13
slapos/proxy/views.py
slapos/proxy/views.py
+19
-13
No files found.
slapos/proxy/views.py
View file @
317d5c8e
...
@@ -294,25 +294,31 @@ def request_not_shared():
...
@@ -294,25 +294,31 @@ def request_not_shared():
q
+=
' AND requested_by=?'
q
+=
' AND requested_by=?'
a
(
partition_id
)
a
(
partition_id
)
partition
=
execute_db
(
'partition'
,
q
,
args
,
one
=
True
)
partition
=
execute_db
(
'partition'
,
q
,
args
,
one
=
True
)
args
=
[]
a
=
args
.
append
q
=
'UPDATE %s SET slap_state="busy"'
# 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'
,
'SELECT * FROM %s WHERE slap_state="free"'
,
(),
one
=
True
)
'SELECT * FROM %s WHERE slap_state="free"'
,
(),
one
=
True
)
if
partition
is
None
:
if
partition
is
None
:
app
.
logger
.
warning
(
'No more free computer partition'
)
app
.
logger
.
warning
(
'No more free computer partition'
)
abort
(
408
)
abort
(
408
)
args
=
[]
q
+=
' ,software_release=?'
a
=
args
.
append
a
(
software_release
)
q
=
'UPDATE %s SET software_release=?, slap_state="busy"'
if
software_type
:
a
(
software_release
)
q
+=
' ,software_type=?'
if
software_type
:
a
(
software_type
)
q
+=
' ,software_type=?'
if
partition_reference
:
a
(
software_type
)
q
+=
' ,partition_reference=?'
if
partition_reference
:
a
(
partition_reference
)
q
+=
' ,partition_reference=?'
if
partition_id
:
a
(
partition_reference
)
q
+=
' ,requested_by=?'
if
partition_id
:
a
(
partition_id
)
q
+=
' ,requested_by=?'
a
(
partition_id
)
# Else: only update partition_parameter_kw
if
instance_xml
:
if
instance_xml
:
q
+=
' ,xml=?'
q
+=
' ,xml=?'
a
(
instance_xml
)
a
(
instance_xml
)
...
...
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