From 11cb47f09259994171e7512d96c3584d6389833b Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Mon, 11 Mar 2013 16:16:45 +0000 Subject: [PATCH] heat clients : Fix --timeout option for heat-boto Fix boto client wrapper so it passes the timeout value to boto fixes bug 1135970 Change-Id: Ic1d242cf038e9244c8fb2efc65659cd6f9976df3 --- heat/cfn_client/boto_client.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/heat/cfn_client/boto_client.py b/heat/cfn_client/boto_client.py index d0c86f3c..a31e853d 100644 --- a/heat/cfn_client/boto_client.py +++ b/heat/cfn_client/boto_client.py @@ -39,22 +39,31 @@ class BotoClient(CloudFormationConnection): return super(BotoClient, self).describe_stacks(stack_name) def create_stack(self, **kwargs): - disable_rollback = True + args = {'disable_rollback': True} if str(kwargs.get('DisableRollback', '')).lower() == 'false': - disable_rollback = False + args['disable_rollback'] = False + + if 'TimeoutInMinutes' in kwargs: + try: + timeout = int(kwargs['TimeoutInMinutes']) + except ValueError: + logger.error("Invalid timeout %s" % kwargs['TimeoutInMinutes']) + return + else: + args['timeout_in_minutes'] = timeout if 'TemplateUrl' in kwargs: return super(BotoClient, self).create_stack( kwargs['StackName'], template_url=kwargs['TemplateUrl'], parameters=kwargs['Parameters'], - disable_rollback=disable_rollback) + **args) elif 'TemplateBody' in kwargs: return super(BotoClient, self).create_stack( kwargs['StackName'], template_body=kwargs['TemplateBody'], parameters=kwargs['Parameters'], - disable_rollback=disable_rollback) + **args) else: logger.error("Must specify TemplateUrl or TemplateBody!") -- 2.45.2