Commit 1ccbc60a authored by Romain Courteaud's avatar Romain Courteaud

Instance bang now returns "OK"

parent 2823ac8b
......@@ -1373,7 +1373,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
error_log = 'Please bang me'
response = self.portal_slap.softwareInstanceBang(self.computer_id,
partition_id, error_log)
self.assertEqual('None', response)
self.assertEqual('OK', response)
created_at = rfc1123_date(DateTime())
response = self.portal_slap.getComputerPartitionStatus(self.computer_id,
partition_id)
......@@ -2143,7 +2143,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
error_log = 'Please bang me'
response = self.portal_slap.softwareInstanceBang(self.computer_id,
partition_id, error_log)
self.assertEqual('None', response)
self.assertEqual('OK', response)
created_at = rfc1123_date(DateTime())
response = self.portal_slap.getComputerPartitionStatus(self.computer_id,
partition_id)
......
30
\ No newline at end of file
31
\ No newline at end of file
......@@ -933,16 +933,15 @@ class SlapTool(BaseTool):
'#error bang called')
timestamp = str(int(software_instance.getModificationDate()))
key = "%s_bangstamp" % software_instance.getReference()
result = "OK"
transition = self.getPortalObject().portal_workflow.getInfoFor(
software_instance, 'action', wf_id='instance_slap_interface_workflow')
if (self._getLastData(key) != timestamp) and \
(transition != 'bang'):
result = software_instance.bang(bang_tree=True, comment=message)
software_instance.bang(bang_tree=True, comment=message)
self._storeLastData(key, str(int(software_instance.getModificationDate())))
return result
return "OK"
def _getAccessStatus(self, context_reference):
memcached_dict = self._getMemcachedDict()
......
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