]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
heat api : Handle DisableRollback parameter in cfn API
authorSteven Hardy <shardy@redhat.com>
Wed, 13 Feb 2013 15:59:05 +0000 (15:59 +0000)
committerSteven Hardy <shardy@redhat.com>
Mon, 18 Feb 2013 20:21:10 +0000 (20:21 +0000)
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

heat/api/cfn/v1/stacks.py
heat/tests/test_api_cfn_v1.py

index 1b645b7d6a62f46336ace3ec97a99020ab523e3b..2be5c5eecfc98adde70a3aaf4601060b439697ee 100644 (file)
@@ -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:
index e9d890c45f1ac869227a79ef80fb8a9d83c9cbf7..45b8e6f4153ce4c2c97e9882b40559858ae7cb74 100644 (file)
@@ -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