diff --git a/heat/engine/service.py b/heat/engine/service.py index f9709304c0..a2cdd4cd2b 100644 --- a/heat/engine/service.py +++ b/heat/engine/service.py @@ -691,6 +691,10 @@ class EngineService(service.Service): msg = _('Updating a stack when it is suspended') raise exception.NotSupported(feature=msg) + if current_stack.action == current_stack.DELETE: + msg = _('Updating a stack when it is deleting') + raise exception.NotSupported(feature=msg) + # Now parse the template and any parameters for the updated # stack definition. tmpl = templatem.Template(template, files=files) diff --git a/heat/tests/test_engine_service.py b/heat/tests/test_engine_service.py index 982c78934a..ce0fdae201 100644 --- a/heat/tests/test_engine_service.py +++ b/heat/tests/test_engine_service.py @@ -1428,21 +1428,24 @@ class StackServiceCreateUpdateDeleteTest(HeatTestCase): six.text_type(ex)) -class StackServiceUpdateSuspendedNotSupportedTest(HeatTestCase): +class StackServiceUpdateActionsNotSupportedTest(HeatTestCase): scenarios = [ ('suspend_in_progress', dict(action='SUSPEND', status='IN_PROGRESS')), ('suspend_complete', dict(action='SUSPEND', status='COMPLETE')), ('suspend_failed', dict(action='SUSPEND', status='FAILED')), + ('delete_in_progress', dict(action='DELETE', status='IN_PROGRESS')), + ('delete_complete', dict(action='DELETE', status='COMPLETE')), + ('delete_failed', dict(action='DELETE', status='FAILED')), ] def setUp(self): - super(StackServiceUpdateSuspendedNotSupportedTest, self).setUp() + super(StackServiceUpdateActionsNotSupportedTest, self).setUp() self.ctx = utils.dummy_context() self.patch('heat.engine.service.warnings') self.man = service.EngineService('a-host', 'a-topic') - def test_stack_update_suspended(self): + def test_stack_update_actions_not_supported(self): stack_name = '%s-%s' % (self.action, self.status) old_stack = get_wordpress_stack(stack_name, self.ctx)