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
Thomas Leymonerie
slapos.core
Commits
f6f2ea94
Commit
f6f2ea94
authored
Mar 18, 2022
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Let the workflow transition (bang) update the error status
parent
bb983933
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
2 deletions
+17
-2
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/compute_node_slap_interface_workflow/script_ComputeNode_reportBang.py
..._slap_interface_workflow/script_ComputeNode_reportBang.py
+2
-0
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/compute_node_slap_interface_workflow/script_ComputeNode_reportBang.xml
...slap_interface_workflow/script_ComputeNode_reportBang.xml
+6
-0
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/script_RequestedInstance_bangInstanceTree.py
...ace_workflow/script_RequestedInstance_bangInstanceTree.py
+3
-0
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/script_RequestedInstance_bangInstanceTree.xml
...ce_workflow/script_RequestedInstance_bangInstanceTree.xml
+6
-0
master/bt5/slapos_slap_tool/ToolComponentTemplateItem/portal_components/tool.erp5.SlapTool.py
...onentTemplateItem/portal_components/tool.erp5.SlapTool.py
+0
-2
No files found.
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/compute_node_slap_interface_workflow/script_ComputeNode_reportBang.py
View file @
f6f2ea94
...
@@ -11,3 +11,5 @@ for compute_partition in [x for x in compute_node.contentValues(portal_type='Com
...
@@ -11,3 +11,5 @@ for compute_partition in [x for x in compute_node.contentValues(portal_type='Com
relative_url
=
instance
.
getRelativeUrl
(),
relative_url
=
instance
.
getRelativeUrl
(),
reference
=
instance
.
getReference
(),
reference
=
instance
.
getReference
(),
comment
=
state_change
.
kwargs
.
get
(
'comment'
,
''
))
comment
=
state_change
.
kwargs
.
get
(
'comment'
,
''
))
compute_node
.
setErrorStatus
(
'bang'
)
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/compute_node_slap_interface_workflow/script_ComputeNode_reportBang.xml
View file @
f6f2ea94
...
@@ -52,6 +52,12 @@
...
@@ -52,6 +52,12 @@
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
state_change
</string>
</value>
<value>
<string>
state_change
</string>
</value>
</item>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
script_ComputeNode_reportBang
</string>
</value>
<value>
<string>
script_ComputeNode_reportBang
</string>
</value>
...
...
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/script_RequestedInstance_bangInstanceTree.py
View file @
f6f2ea94
...
@@ -3,6 +3,9 @@ instance = state_change['object']
...
@@ -3,6 +3,9 @@ instance = state_change['object']
assert
instance
.
getPortalType
()
in
[
"Slave Instance"
,
"Software Instance"
]
assert
instance
.
getPortalType
()
in
[
"Slave Instance"
,
"Software Instance"
]
instance
.
edit
(
bang_timestamp
=
int
(
DateTime
()))
instance
.
edit
(
bang_timestamp
=
int
(
DateTime
()))
key
=
"%s_bangstamp"
%
instance
.
getReference
()
instance
.
setLastData
(
key
,
str
(
int
(
instance
.
getModificationDate
())))
comment
=
state_change
.
kwargs
[
'comment'
]
# comment is required to pass the transition
comment
=
state_change
.
kwargs
[
'comment'
]
# comment is required to pass the transition
if
state_change
.
kwargs
[
'bang_tree'
]:
if
state_change
.
kwargs
[
'bang_tree'
]:
from
Products.ZSQLCatalog.SQLCatalog
import
Query
,
NegatedQuery
from
Products.ZSQLCatalog.SQLCatalog
import
Query
,
NegatedQuery
...
...
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/script_RequestedInstance_bangInstanceTree.xml
View file @
f6f2ea94
...
@@ -60,6 +60,12 @@
...
@@ -60,6 +60,12 @@
</tuple>
</tuple>
</value>
</value>
</item>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
script_RequestedInstance_bangInstanceTree
</string>
</value>
<value>
<string>
script_RequestedInstance_bangInstanceTree
</string>
</value>
...
...
master/bt5/slapos_slap_tool/ToolComponentTemplateItem/portal_components/tool.erp5.SlapTool.py
View file @
f6f2ea94
...
@@ -605,7 +605,6 @@ class SlapTool(BaseTool):
...
@@ -605,7 +605,6 @@ class SlapTool(BaseTool):
Fire up bung on Compute Node
Fire up bung on Compute Node
"""
"""
compute_node
=
self
.
_getComputeNodeDocument
(
compute_node_id
)
compute_node
=
self
.
_getComputeNodeDocument
(
compute_node_id
)
compute_node
.
setErrorStatus
(
'bang'
)
return
compute_node
.
reportComputeNodeBang
(
comment
=
message
)
return
compute_node
.
reportComputeNodeBang
(
comment
=
message
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
...
@@ -883,7 +882,6 @@ class SlapTool(BaseTool):
...
@@ -883,7 +882,6 @@ class SlapTool(BaseTool):
if
(
software_instance
.
getLastData
(
key
)
!=
timestamp
):
if
(
software_instance
.
getLastData
(
key
)
!=
timestamp
):
software_instance
.
bang
(
bang_tree
=
True
,
comment
=
message
)
software_instance
.
bang
(
bang_tree
=
True
,
comment
=
message
)
software_instance
.
setLastData
(
key
,
str
(
int
(
software_instance
.
getModificationDate
())))
return
"OK"
return
"OK"
@
convertToREST
@
convertToREST
...
...
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