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
19
Merge Requests
19
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
9cdf75b4
Commit
9cdf75b4
authored
Mar 18, 2022
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Include isLastData
Help evaluate if the data is actually the last already
parent
a1c78301
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
master/bt5/slapos_cloud/MixinTemplateItem/portal_components/mixin.erp5.SlapOSCacheMixin.py
...lateItem/portal_components/mixin.erp5.SlapOSCacheMixin.py
+4
-1
master/bt5/slapos_slap_tool/ToolComponentTemplateItem/portal_components/tool.erp5.SlapTool.py
...onentTemplateItem/portal_components/tool.erp5.SlapTool.py
+9
-7
No files found.
master/bt5/slapos_cloud/MixinTemplateItem/portal_components/mixin.erp5.SlapOSCacheMixin.py
View file @
9cdf75b4
...
@@ -180,4 +180,7 @@ class SlapOSCacheMixin:
...
@@ -180,4 +180,7 @@ class SlapOSCacheMixin:
entry
=
None
entry
=
None
else
:
else
:
entry
=
entry
.
getValue
()
entry
=
entry
.
getValue
()
return
entry
return
entry
\ No newline at end of file
def
isLastData
(
self
,
key
=
None
,
value
=
None
):
return
self
.
getLastData
(
key
)
==
value
\ No newline at end of file
master/bt5/slapos_slap_tool/ToolComponentTemplateItem/portal_components/tool.erp5.SlapTool.py
View file @
9cdf75b4
...
@@ -173,7 +173,11 @@ class SlapTool(BaseTool):
...
@@ -173,7 +173,11 @@ class SlapTool(BaseTool):
compute_node
=
self
.
getPortalObject
().
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
compute_node
=
self
.
getPortalObject
().
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
compute_node
.
setAccessStatus
(
computer_id
)
compute_node
.
setAccessStatus
(
computer_id
)
else
:
else
:
compute_node
=
self
.
_getComputeNodeDocument
(
computer_id
)
# Don't use getDocument because we don't want use _assertACI here, but
# just call the API on computer.
compute_node
=
self
.
getPortalObject
().
portal_catalog
.
unrestrictedSearchResults
(
portal_type
=
'Compute Node'
,
reference
=
computer_id
,
validation_state
=
"validated"
)[
0
].
getObject
()
refresh_etag
=
compute_node
.
_calculateRefreshEtag
()
refresh_etag
=
compute_node
.
_calculateRefreshEtag
()
body
,
etag
=
compute_node
.
_getComputeNodeInformation
(
user
,
refresh_etag
)
body
,
etag
=
compute_node
.
_getComputeNodeInformation
(
user
,
refresh_etag
)
...
@@ -877,10 +881,7 @@ class SlapTool(BaseTool):
...
@@ -877,10 +881,7 @@ class SlapTool(BaseTool):
timestamp
=
str
(
int
(
software_instance
.
getModificationDate
()))
timestamp
=
str
(
int
(
software_instance
.
getModificationDate
()))
key
=
"%s_bangstamp"
%
software_instance
.
getReference
()
key
=
"%s_bangstamp"
%
software_instance
.
getReference
()
self
.
getPortalObject
().
portal_workflow
.
getInfoFor
(
if
not
software_instance
.
isLastData
(
key
,
timestamp
):
software_instance
,
'action'
,
wf_id
=
'instance_slap_interface_workflow'
)
if
(
software_instance
.
getLastData
(
key
)
!=
timestamp
):
software_instance
.
bang
(
bang_tree
=
True
,
comment
=
message
)
software_instance
.
bang
(
bang_tree
=
True
,
comment
=
message
)
return
"OK"
return
"OK"
...
@@ -915,6 +916,7 @@ class SlapTool(BaseTool):
...
@@ -915,6 +916,7 @@ class SlapTool(BaseTool):
instance
=
self
.
_getSoftwareInstanceForComputePartition
(
instance
=
self
.
_getSoftwareInstanceForComputePartition
(
compute_node_id
,
compute_node_id
,
compute_partition_id
)
compute_partition_id
)
if
instance
.
getSlapState
()
==
'destroy_requested'
:
if
instance
.
getSlapState
()
==
'destroy_requested'
:
# remove certificate from SI
# remove certificate from SI
if
instance
.
getSslKey
()
is
not
None
or
instance
.
getSslCertificate
()
is
not
None
:
if
instance
.
getSslKey
()
is
not
None
or
instance
.
getSslCertificate
()
is
not
None
:
...
@@ -952,7 +954,7 @@ class SlapTool(BaseTool):
...
@@ -952,7 +954,7 @@ class SlapTool(BaseTool):
compute_partition_id
,
compute_partition_id
,
slave_reference
)
slave_reference
)
connection_xml
=
dict2xml
(
loads
(
connection_xml
))
connection_xml
=
dict2xml
(
loads
(
connection_xml
))
if
software_instance
.
getLastData
()
!=
connection_xml
:
if
not
software_instance
.
isLastData
(
value
=
connection_xml
)
:
software_instance
.
updateConnection
(
software_instance
.
updateConnection
(
connection_xml
=
connection_xml
,
connection_xml
=
connection_xml
,
)
)
...
@@ -1115,7 +1117,7 @@ class SlapTool(BaseTool):
...
@@ -1115,7 +1117,7 @@ class SlapTool(BaseTool):
compute_partition_id
)
compute_partition_id
)
cache_reference
=
'%s-PREDLIST'
%
software_instance_document
.
getReference
()
cache_reference
=
'%s-PREDLIST'
%
software_instance_document
.
getReference
()
if
software_instance_document
.
getLastData
(
cache_reference
)
!=
instance_reference_xml
:
if
not
software_instance_document
.
isLastData
(
cache_reference
,
instance_reference_xml
)
:
instance_reference_list
=
loads
(
instance_reference_xml
)
instance_reference_list
=
loads
(
instance_reference_xml
)
current_successor_list
=
software_instance_document
.
getSuccessorValueList
(
current_successor_list
=
software_instance_document
.
getSuccessorValueList
(
...
...
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