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
Roque
slapos.core
Commits
360adef0
Commit
360adef0
authored
Oct 31, 2012
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter by instance_guid; removed redundant syntax
parent
457dbb94
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
21 deletions
+33
-21
slapos/proxy/views.py
slapos/proxy/views.py
+33
-21
No files found.
slapos/proxy/views.py
View file @
360adef0
...
...
@@ -331,7 +331,9 @@ def request_not_shared():
address_list
=
[]
for
address
in
execute_db
(
'partition_network'
,
'SELECT * FROM %s WHERE partition_reference=?'
,
[
partition
[
'reference'
]]):
address_list
.
append
((
address
[
'reference'
],
address
[
'address'
]))
return
xml_marshaller
.
xml_marshaller
.
dumps
(
SoftwareInstance
(
**
dict
(
# XXX it should be ComputerPartition, not a SoftwareInstance
return
xml_marshaller
.
xml_marshaller
.
dumps
(
SoftwareInstance
(
xml
=
partition
[
'xml'
],
connection_xml
=
partition
[
'connection_xml'
],
slap_computer_id
=
app
.
config
[
'computer_id'
],
...
...
@@ -340,8 +342,9 @@ def request_not_shared():
slap_server_url
=
'slap_server_url'
,
slap_software_type
=
partition
[
'software_type'
],
slave_instance_list
=
partition
[
'slave_instance_list'
],
instance_guid
=
partition
[
'reference'
],
ip_list
=
address_list
)
))
))
abort
(
408
)
raise
NotImplementedError
...
...
@@ -369,6 +372,9 @@ def request_slave():
partition_parameter_kw
.
encode
())
else
:
partition_parameter_kw
=
{}
filter_kw
=
xml_marshaller
.
xml_marshaller
.
loads
(
request
.
form
.
get
(
'filter_xml'
).
encode
())
instance_xml
=
dict2xml
(
partition_parameter_kw
)
# We will search for a master corresponding to request
args
=
[]
...
...
@@ -378,6 +384,10 @@ def request_slave():
if
software_type
:
q
+=
' AND software_type=?'
a
(
software_type
)
if
'instance_guid'
in
filter_kw
:
q
+=
' AND reference=?'
a
(
filter_kw
[
'instance_guid'
])
partition
=
execute_db
(
'partition'
,
q
,
args
,
one
=
True
)
if
partition
is
None
:
app
.
logger
.
warning
(
'No partition corresponding to slave request: %s'
%
\
...
...
@@ -434,7 +444,9 @@ def request_slave():
'SELECT * FROM %s WHERE partition_reference=?'
,
[
partition
[
'reference'
]]):
address_list
.
append
((
address
[
'reference'
],
address
[
'address'
]))
return
xml_marshaller
.
xml_marshaller
.
dumps
(
SoftwareInstance
(
**
dict
(
# XXX it should be ComputerPartition, not a SoftwareInstance
return
xml_marshaller
.
xml_marshaller
.
dumps
(
SoftwareInstance
(
_connection_dict
=
xml2dict
(
slave
[
'connection_xml'
]),
xml
=
instance_xml
,
slap_computer_id
=
app
.
config
[
'computer_id'
],
...
...
@@ -443,4 +455,4 @@ def request_slave():
slap_server_url
=
'slap_server_url'
,
slap_software_type
=
partition
[
'software_type'
],
ip_list
=
address_list
)
))
))
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