Set a default timeout for 240 minutes for Heat Updates

This matches the behaviour in python-tripleoclient and helps us
avoid Heat timing out the update.

Change-Id: Iae80be66338f88b85b6df7a45055ea84cb5f47b0
This commit is contained in:
Dougal Matthews 2015-12-01 11:57:22 +00:00
parent a7841162ff
commit 84041092c8
4 changed files with 9 additions and 5 deletions

View File

@ -92,7 +92,7 @@ class ScaleManager(object):
self._update_stack(parameters=stack_params)
def _update_stack(self, parameters={}):
def _update_stack(self, parameters={}, timeout_mins=240):
tpl_files, template = template_utils.get_template_contents(
template_file=os.path.join(self.tht_dir, TEMPLATE_NAME))
@ -112,7 +112,8 @@ class ScaleManager(object):
'files': dict(list(tpl_files.items()) +
list(env_files.items())),
'environment': env,
'parameters': parameters
'parameters': parameters,
'timeout_mins': timeout_mins
}
LOG.debug('stack update params: %s', fields)

View File

@ -84,6 +84,7 @@ class ScaleManagerTest(base.TestCase):
environment=env,
existing=True,
files={},
timeout_mins=240,
parameters={
'ComputeCount': '0',
'ComputeRemovalPolicies': [

View File

@ -59,7 +59,8 @@ class UpdateManagerTest(base.TestCase):
}
}
}
}
},
'timeout_mins': 240,
}
heatclient.stacks.update.assert_called_once_with(**params)
mock_env_files.assert_called_once_with(env_paths=[])

View File

@ -44,7 +44,7 @@ class PackageUpdateManager(stack_update.StackUpdateManager):
hook_type='pre-update', nested_depth=5,
hook_resource=UPDATE_RESOURCE_NAME)
def update(self):
def update(self, timeout_mins=240):
# time rounded to seconds
timestamp = int(time.time())
@ -76,7 +76,8 @@ class PackageUpdateManager(stack_update.StackUpdateManager):
'files': dict(list(tpl_files.items()) +
list(env_files.items())),
'environment': env,
'parameters': stack_params
'parameters': stack_params,
'timeout_mins': timeout_mins,
}
LOG.info('updating stack: %s', self.stack.stack_name)