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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
74bc8891
Commit
74bc8891
authored
Dec 01, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_upgrader: some sla xml seems broken
parent
eb5d1265
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/InstanceTree_checkSiteMigrationToVirtualMaster.py
...pgrader/InstanceTree_checkSiteMigrationToVirtualMaster.py
+14
-6
No files found.
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/InstanceTree_checkSiteMigrationToVirtualMaster.py
View file @
74bc8891
...
...
@@ -10,6 +10,14 @@ instance_tree = context.getObject()
instance_tree_relative_url
=
instance_tree
.
getRelativeUrl
()
software_instance
=
([
x
for
x
in
instance_tree
.
getSuccessorValueList
()
if
x
.
getTitle
()
==
instance_tree
.
getTitle
()]
+
[
None
])[
0
]
sla_xml_dict
=
{}
if
software_instance
is
None
:
try
:
sla_xml_dict
=
software_instance
.
getSlaXmlAsDict
()
except
:
# XMLSyntaxError
pass
last_affectation_list
=
instance_tree
.
Item_getAffectationList
()
project_relative_url
=
None
if
last_affectation_list
and
last_affectation_list
[
0
].
project_uid
:
...
...
@@ -34,16 +42,16 @@ if not_migrated_instance_tree_dict[instance_tree_relative_url]['project_relative
not_migrated_instance_tree_dict
.
pop
(
instance_tree_relative_url
)
# Node requested to be allocated on a specific project
elif
(
software_instance
is
not
None
)
and
(
s
oftware_instance
.
getSlaXmlAsDict
()
.
get
(
'project_guid'
,
None
)
is
not
None
):
project_reference
=
s
oftware_instance
.
getSlaXmlAsDict
()
.
get
(
'project_guid'
,
None
)
elif
(
software_instance
is
not
None
)
and
(
s
la_xml_dict
.
get
(
'project_guid'
,
None
)
is
not
None
):
project_reference
=
s
la_xml_dict
.
get
(
'project_guid'
,
None
)
project
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Project'
,
reference
=
project_reference
)
if
project
is
not
None
:
instance_tree
.
activate
().
Base_activateObjectMigrationToVirtualMaster
(
project
.
getRelativeUrl
())
not_migrated_instance_tree_dict
.
pop
(
instance_tree_relative_url
)
# Node requested to be allocated on a specific node
elif
(
software_instance
is
not
None
)
and
(
s
oftware_instance
.
getSlaXmlAsDict
()
.
get
(
'computer_guid'
,
None
)
is
not
None
):
project_instance_reference
=
s
oftware_instance
.
getSlaXmlAsDict
()
.
get
(
'computer_guid'
,
None
)
elif
(
software_instance
is
not
None
)
and
(
s
la_xml_dict
.
get
(
'computer_guid'
,
None
)
is
not
None
):
project_instance_reference
=
s
la_xml_dict
.
get
(
'computer_guid'
,
None
)
project_instance
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Compute Node'
,
reference
=
project_instance_reference
)
if
project_instance
is
not
None
:
...
...
@@ -53,8 +61,8 @@ elif (software_instance is not None) and (software_instance.getSlaXmlAsDict().ge
not_migrated_instance_tree_dict
.
pop
(
instance_tree_relative_url
)
# Slave Node requested to be allocated on a specific project instance
elif
(
software_instance
is
not
None
)
and
(
s
oftware_instance
.
getSlaXmlAsDict
()
.
get
(
'instance_guid'
,
None
)
is
not
None
):
project_instance_reference
=
s
oftware_instance
.
getSlaXmlAsDict
()
.
get
(
'instance_guid'
,
None
)
elif
(
software_instance
is
not
None
)
and
(
s
la_xml_dict
.
get
(
'instance_guid'
,
None
)
is
not
None
):
project_instance_reference
=
s
la_xml_dict
.
get
(
'instance_guid'
,
None
)
project_instance
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Software Instance'
,
reference
=
project_instance_reference
)
if
project_instance
is
not
None
:
...
...
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