Fix Software Deployment DELETE action for CFN_SIGNAL transport

This is a regression from https://review.openstack.org/#/c/198183.

Change-Id: I76702f12130e18c9e5f036e9e771e8b44fa8da78
Closes-Bug: #1488058
This commit is contained in:
Rabi Mishra 2015-08-24 17:19:13 +05:30
parent e7ae699652
commit 6c29d7a842
2 changed files with 7 additions and 4 deletions

View File

@ -92,8 +92,8 @@ class SignalResponder(stack_user.StackUser):
secret_key = self.data().get('secret_key')
if not access_key or not secret_key:
if self.id is None or self.action == self.DELETE:
# it is either too early or too late to do this
if self.id is None:
# it is too early
return
if self._get_user_id() is None:
self._create_user()

View File

@ -339,9 +339,11 @@ class SignalTest(common.HeatTestCase):
self.stack = self.create_stack()
self.m.StubOutWithMock(self.stack.clients.client_plugin('heat'),
'get_heat_cfn_url')
self.stack.clients.client_plugin('heat').get_heat_cfn_url().AndReturn(
'http://server.test:8000/v1')
self.stack.clients.client_plugin('heat').get_heat_cfn_url().AndReturn(
'http://server.test:8000/v1')
self.m.ReplayAll()
self.stack.create()
@ -353,7 +355,8 @@ class SignalTest(common.HeatTestCase):
rsrc.FnGetAtt('AlarmUrl'))
scheduler.TaskRunner(rsrc.delete)()
self.assertEqual('None', rsrc.FnGetAtt('AlarmUrl'))
self.assertIn('http://server.test:8000/v1/signal',
rsrc.FnGetAtt('AlarmUrl'))
self.m.VerifyAll()