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
16
Merge Requests
16
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
69e53d9e
Commit
69e53d9e
authored
Jun 08, 2017
by
Tomáš Peterka
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into amarisoft
Conflicts: slapos/format.py slapos/tests/slapformat.py
parents
515d3366
ca70b595
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
slapos/format.py
slapos/format.py
+2
-0
slapos/proxy/views.py
slapos/proxy/views.py
+12
-8
No files found.
slapos/format.py
View file @
69e53d9e
...
...
@@ -61,12 +61,14 @@ from slapos.util import mkdir_p
import
slapos.slap
as
slap
from
slapos
import
version
logger
=
logging
.
getLogger
(
"slapos.format"
)
# dict[str: ManagerClass] used in configuration and XML dump of computer
# this dictionary is intended to be filled after each definition of a Manager
available_managers
=
{}
def
prettify_xml
(
xml
):
root
=
lxml
.
etree
.
fromstring
(
xml
)
return
lxml
.
etree
.
tostring
(
root
,
pretty_print
=
True
)
...
...
slapos/proxy/views.py
View file @
69e53d9e
...
...
@@ -554,17 +554,21 @@ def getAllocatedSlaveInstance(slave_reference, requested_computer_id):
return
execute_db
(
table
,
q
,
args
,
one
=
True
)
def
getRootPartition
(
reference
):
"""Climb the partitions tree up by 'requested_by' link to get the root partition."""
p
=
'SELECT * FROM %s WHERE reference=?'
parent_partition
=
execute_db
(
'partition'
,
p
,
[
reference
],
one
=
True
)
partition
=
execute_db
(
'partition'
,
p
,
[
reference
],
one
=
True
)
if
partition
is
None
:
return
while
parent_partition
is
not
None
:
parent_reference
=
parent_partition
[
'requested_by'
]
if
not
parent_reference
or
parent_reference
==
reference
:
break
reference
=
parent_reference
parent_partition
=
execute_db
(
'partition'
,
p
,
[
partition
[
'requested_by'
]],
one
=
True
)
while
(
parent_partition
is
not
None
and
parent_partition
[
'requested_by'
]
and
parent_partition
[
'requested_by'
]
!=
reference
):
partition
=
parent_partition
reference
=
parent_partition
[
'requested_by'
]
parent_partition
=
execute_db
(
'partition'
,
p
,
[
reference
],
one
=
True
)
return
par
ent_par
tition
return
partition
def
requestNotSlave
(
software_release
,
software_type
,
partition_reference
,
partition_id
,
partition_parameter_kw
,
filter_kw
,
requested_state
):
instance_xml
=
dict2xml
(
partition_parameter_kw
)
...
...
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