Merge "Revert "Set Deployment Parameters""

This commit is contained in:
Jenkins
2016-09-02 12:42:35 +00:00
committed by Gerrit Code Review
+2 -25
View File
@@ -133,40 +133,17 @@ class DeployStackAction(templates.ProcessTemplatesAction):
self.timeout_mins = timeout
def run(self):
# check to see if the stack exists
processed_data = super(DeployStackAction, self).run()
heat = self._get_orchestration_client()
try:
stack = heat.stacks.get(self.container)
except heat_exc.HTTPNotFound:
stack = None
stack_is_new = stack is None
# update StackAction, DeployIdentifier and UpdateIdentifier
wc = self._get_workflow_client()
wf_env = wc.environments.get(self.container)
parameters = dict()
timestamp = int(time.time())
parameters['DeployIdentifier'] = timestamp
parameters['UpdateIdentifier'] = ''
parameters['StackAction'] = 'CREATE' if stack_is_new else 'UPDATE'
env_kwargs = {
'name': wf_env.name,
'variables': wf_env.variables.update(
{'parameter_defaults': parameters}
)
}
# store params changes back to db before call to process templates
wc.environments.update(**env_kwargs)
# process all plan files and create or update a stack
processed_data = super(DeployStackAction, self).run()
stack_args = processed_data.copy()
stack_args['timeout_mins'] = self.timeout_mins
if stack_is_new:
if stack is None:
LOG.info("Perfoming Heat stack create")
return heat.stacks.create(**stack_args)