Commit 32796f5d authored by Rafael Monnerat's avatar Rafael Monnerat

SlapOSTool: Timestamp must use Slave Instance Modification Date as failover for getBangTimestamp

  If we do otherwise, and if the timestamp is propagated (send in another request), there is a chain of infinity
  recursive bangs
parent ce25152d
...@@ -1542,7 +1542,7 @@ class SlapTool(BaseTool): ...@@ -1542,7 +1542,7 @@ class SlapTool(BaseTool):
slave_instance = _assertACI(slave_instance.getObject()) slave_instance = _assertACI(slave_instance.getObject())
# XXX Use catalog to filter more efficiently # XXX Use catalog to filter more efficiently
if slave_instance.getSlapState() == "start_requested": if slave_instance.getSlapState() == "start_requested":
newtimestamp = int(slave_instance.getBangTimestamp(int(software_instance.getModificationDate()))) newtimestamp = int(slave_instance.getBangTimestamp(int(slave_instance.getModificationDate())))
append({ append({
'slave_title': slave_instance.getTitle().decode("UTF-8"), 'slave_title': slave_instance.getTitle().decode("UTF-8"),
'slap_software_type': \ 'slap_software_type': \
...@@ -1552,7 +1552,7 @@ class SlapTool(BaseTool): ...@@ -1552,7 +1552,7 @@ class SlapTool(BaseTool):
'xml': slave_instance.getTextContent(), 'xml': slave_instance.getTextContent(),
'connection_xml': slave_instance.getConnectionXml(), 'connection_xml': slave_instance.getConnectionXml(),
}) })
if (newtimestamp > timestamp): if (newtimestamp > timestamp):
timestamp = newtimestamp timestamp = newtimestamp
return { return {
'instance_guid': software_instance.getReference().decode("UTF-8"), 'instance_guid': software_instance.getReference().decode("UTF-8"),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment