Commit d1c03593 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: Bang after request destroy, to ensure the whole Hosting Subscription is processed

parent fa0ebacf
......@@ -62,7 +62,7 @@ def SoftwareInstance_renameAndRequestDestroy(self, REQUEST=None):
if REQUEST is not None:
raise Unauthorized
assert self.getPortalType() in ["Software Instance", "Slave Instance"]
assert self.getPortalType() in ["Software Instance", "Slave Instance"]
title = self.getTitle()
new_title = title + "_renamed_and_destroyed_%s" % (DateTime().strftime("%Y%m%d_%H%M%S"))
self.rename(new_name=new_title,
......@@ -85,4 +85,12 @@ def SoftwareInstance_renameAndRequestDestroy(self, REQUEST=None):
for name in [title, new_title]:
# reset request cache
key = '_'.join([hosting_subscription, name])
self.getPortalObject().portal_slap._storeLastData(key, {})
\ No newline at end of file
self.getPortalObject().portal_slap._storeLastData(key, {})
# Them call bang to enforce tree to reprocess.
timestamp = str(int(self.getModificationDate()))
key = "%s_bangstamp" % self.getReference()
if (self.portal_slap._getLastData(key) != timestamp):
self.bang(bang_tree=True, comment="Instance was destroyed.")
self.portal_slap._storeLastData(key, str(int(self.getModificationDate())))
......@@ -120,6 +120,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......
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