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
d23c3231
Commit
d23c3231
authored
Nov 30, 2023
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: allow to propagate a single instance
parent
2c2f83cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputePartition_propagateRemoteNode.py
...kins/slapos_cloud/ComputePartition_propagateRemoteNode.py
+16
-12
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputePartition_propagateRemoteNode.xml
...ins/slapos_cloud/ComputePartition_propagateRemoteNode.xml
+1
-1
No files found.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputePartition_propagateRemoteNode.py
View file @
d23c3231
...
...
@@ -11,22 +11,26 @@ assert remote_node.getPortalType() == 'Remote Node'
remote_project
=
remote_node
.
getDestinationProjectValue
(
portal_type
=
'Project'
)
remote_person
=
remote_node
.
getDestinationSectionValue
(
portal_type
=
'Person'
)
if
compute_partition
.
getId
()
==
'SHARED_REMOTE'
:
# Hardcoded ID behaviour
local_instance_list
=
portal
.
portal_catalog
(
portal_type
=
'Slave Instance'
,
aggregate__uid
=
compute_partition
.
getUid
(),
validation_state
=
'validated'
)
if
local_instance_list
is
None
:
if
compute_partition
.
getId
()
==
'SHARED_REMOTE'
:
# Hardcoded ID behaviour
local_instance_list
=
portal
.
portal_catalog
(
portal_type
=
'Slave Instance'
,
aggregate__uid
=
compute_partition
.
getUid
(),
validation_state
=
'validated'
)
else
:
local_instance_list
=
portal
.
portal_catalog
(
portal_type
=
'Software Instance'
,
aggregate__uid
=
compute_partition
.
getUid
(),
validation_state
=
'validated'
)
else
:
local_instance_list
=
portal
.
portal_catalog
(
portal_type
=
'Software Instance'
,
aggregate__uid
=
compute_partition
.
getUid
(),
validation_state
=
'validated'
)
local_instance_list
=
[
portal
.
restrictedTraverse
(
x
)
for
x
in
local_instance_list
]
for
local_instance
in
local_instance_list
:
assert
local_instance
.
getAggregate
()
==
compute_partition
.
getRelativeUrl
()
# If local instance destruction has been propagated, do nothing
if
local_instance
.
getValidationState
()
!=
'validated'
:
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputePartition_propagateRemoteNode.xml
View file @
d23c3231
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
activate_kw=None, REQUEST=None
</string>
</value>
<value>
<string>
local_instance_list=None,
activate_kw=None, REQUEST=None
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
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