From: Steven Hardy Date: Wed, 13 Feb 2013 15:59:05 +0000 (+0000) Subject: heat api : Handle DisableRollback parameter in cfn API X-Git-Tag: 2014.1~892 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ab8cbf3d326dc34e0537d589c991686f53d16502;p=openstack-build%2Fheat-build.git heat api : Handle DisableRollback parameter in cfn API Previously we ignored DisableRollback for create/update, pass it to the engine since the engine API now supports it blueprint stack-rollback Change-Id: I926d843a88449fa61b665bd1b47946724f6d2ce5 --- diff --git a/heat/api/cfn/v1/stacks.py b/heat/api/cfn/v1/stacks.py index 1b645b7d..2be5c5ee 100644 --- a/heat/api/cfn/v1/stacks.py +++ b/heat/api/cfn/v1/stacks.py @@ -279,8 +279,9 @@ class StackController(object): the engine API. FIXME: we currently only support a subset of the AWS defined parameters (both here and in the engine) """ - # TODO : Capabilities, DisableRollback, NotificationARNs - keymap = {'TimeoutInMinutes': engine_api.PARAM_TIMEOUT, } + # TODO : Capabilities, NotificationARNs + keymap = {'TimeoutInMinutes': engine_api.PARAM_TIMEOUT, + 'DisableRollback': engine_api.PARAM_DISABLE_ROLLBACK} result = {} for k in keymap: diff --git a/heat/tests/test_api_cfn_v1.py b/heat/tests/test_api_cfn_v1.py index e9d890c4..45b8e6f4 100644 --- a/heat/tests/test_api_cfn_v1.py +++ b/heat/tests/test_api_cfn_v1.py @@ -220,7 +220,7 @@ class CfnStackControllerTest(unittest.TestCase): u'notification_topics': [], u'stack_status': u'CREATE_COMPLETE', u'description': u'blah', - u'disable_rollback': True, + u'disable_rollback': 'true', u'timeout_mins':60, u'capabilities':[]}] @@ -268,7 +268,7 @@ class CfnStackControllerTest(unittest.TestCase): 'StackName': u'wordpress', 'NotificationARNs': [], 'StackStatus': u'CREATE_COMPLETE', - 'DisableRollback': True, + 'DisableRollback': 'true', 'LastUpdatedTime': u'2012-07-09T09:13:11Z'}]}}} self.assertEqual(response, expected) @@ -307,7 +307,7 @@ class CfnStackControllerTest(unittest.TestCase): u'notification_topics': [], u'stack_status': u'CREATE_COMPLETE', u'description': u'blah', - u'disable_rollback': True, + u'disable_rollback': 'true', u'timeout_mins':60, u'capabilities':[]}] @@ -351,7 +351,7 @@ class CfnStackControllerTest(unittest.TestCase): 'StackName': u'wordpress', 'NotificationARNs': [], 'StackStatus': u'CREATE_COMPLETE', - 'DisableRollback': True, + 'DisableRollback': 'true', 'LastUpdatedTime': u'2012-07-09T09:13:11Z'}]}}} self.assertEqual(response, expected) @@ -445,10 +445,11 @@ class CfnStackControllerTest(unittest.TestCase): params = {'Action': 'CreateStack', 'StackName': stack_name, 'TemplateBody': '%s' % json_template, 'TimeoutInMinutes': 30, + 'DisableRollback': 'true', 'Parameters.member.1.ParameterKey': 'InstanceType', 'Parameters.member.1.ParameterValue': 'm1.xlarge'} engine_parms = {u'InstanceType': u'm1.xlarge'} - engine_args = {'timeout_mins': u'30'} + engine_args = {'timeout_mins': u'30', 'disable_rollback': 'true'} dummy_req = self._dummy_GET_request(params) # Stub out the RPC call to the engine with a pre-canned response