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
e57cfcd4
Commit
e57cfcd4
authored
Nov 15, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: alarm must visit allocated Slave Instance to invalidate them
parent
d10490cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Alarm_invalidateDestroyedInstance.py
...l_skins/slapos_cloud/Alarm_invalidateDestroyedInstance.py
+0
-5
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAlarm.py
...eItem/portal_components/test.erp5.testSlapOSCloudAlarm.py
+21
-1
No files found.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Alarm_invalidateDestroyedInstance.py
View file @
e57cfcd4
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
select_dict
=
{
'default_aggregate_uid'
:
None
}
portal
.
portal_catalog
.
searchAndActivate
(
portal
.
portal_catalog
.
searchAndActivate
(
portal_type
=
(
'Slave Instance'
,
'Software Instance'
),
portal_type
=
(
'Slave Instance'
,
'Software Instance'
),
validation_state
=
'validated'
,
validation_state
=
'validated'
,
default_aggregate_uid
=
None
,
select_dict
=
select_dict
,
left_join_list
=
select_dict
.
keys
(),
method_id
=
'SoftwareInstance_tryToInvalidateIfDestroyed'
,
method_id
=
'SoftwareInstance_tryToInvalidateIfDestroyed'
,
activate_kw
=
{
'tag'
:
tag
},
activate_kw
=
{
'tag'
:
tag
},
**
{
"slapos_item.slap_state"
:
"destroy_requested"
}
**
{
"slapos_item.slap_state"
:
"destroy_requested"
}
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAlarm.py
View file @
e57cfcd4
...
@@ -1126,6 +1126,8 @@ class TestSlapOSInvalidateDestroyedInstance(SlapOSTestCaseMixin):
...
@@ -1126,6 +1126,8 @@ class TestSlapOSInvalidateDestroyedInstance(SlapOSTestCaseMixin):
)
)
def
test_tryToInvalidateIfDestroyed_alarm_softwareInstanceAllocated
(
self
):
def
test_tryToInvalidateIfDestroyed_alarm_softwareInstanceAllocated
(
self
):
# This use case is not needed by the alarm
# But it keeps alarm search way simpler
instance_tree
=
self
.
addInstanceTree
()
instance_tree
=
self
.
addInstanceTree
()
software_instance
=
instance_tree
.
getSuccessorValue
()
software_instance
=
instance_tree
.
getSuccessorValue
()
...
@@ -1137,7 +1139,25 @@ class TestSlapOSInvalidateDestroyedInstance(SlapOSTestCaseMixin):
...
@@ -1137,7 +1139,25 @@ class TestSlapOSInvalidateDestroyedInstance(SlapOSTestCaseMixin):
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
software_instance
,
'destroy_requested'
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
software_instance
,
'destroy_requested'
)
self
.
tic
()
self
.
tic
()
self
.
_test_alarm_not_visited
(
self
.
_test_alarm
(
self
.
portal
.
portal_alarms
.
slapos_cloud_invalidate_destroyed_instance
,
software_instance
,
'SoftwareInstance_tryToInvalidateIfDestroyed'
)
def
test_tryToInvalidateIfDestroyed_alarm_slaveInstanceAllocated
(
self
):
instance_tree
=
self
.
addInstanceTree
(
shared
=
True
)
software_instance
=
instance_tree
.
getSuccessorValue
()
_
,
partition
=
self
.
addComputeNodeAndPartition
(
project
=
instance_tree
.
getFollowUpValue
())
software_instance
.
setAggregateValue
(
partition
)
partition
.
markBusy
()
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
software_instance
,
'validated'
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
software_instance
,
'destroy_requested'
)
self
.
tic
()
self
.
_test_alarm
(
self
.
portal
.
portal_alarms
.
slapos_cloud_invalidate_destroyed_instance
,
self
.
portal
.
portal_alarms
.
slapos_cloud_invalidate_destroyed_instance
,
software_instance
,
software_instance
,
'SoftwareInstance_tryToInvalidateIfDestroyed'
'SoftwareInstance_tryToInvalidateIfDestroyed'
...
...
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