Do not disregard tags when updating stacks

At present, if tags are supplied to the update_stack function, it is
completely disregarded while create_stack in fact allows it. This leads
the Ansible module os_stack to also not be able to propagate tags
properly. This is suboptimal therefore this patch aims to sort the issue
out.

Resolves: https://github.com/ansible/ansible/pull/53757

Change-Id: I59e7c47b8c01f96ec561b8bd153804bac5f21800
Story: 2005226
Task: 30008
This commit is contained in:
Bharat Kunwar 2019-03-14 00:16:30 +00:00 committed by Pierre Riteau
parent 1a4ed826b9
commit a0ec8ef7fd
2 changed files with 6 additions and 1 deletions

View File

@ -110,7 +110,7 @@ class OrchestrationCloudMixin(_normalize.Normalizer):
self, name_or_id,
template_file=None, template_url=None,
template_object=None, files=None,
rollback=True,
rollback=True, tags=None,
wait=False, timeout=3600,
environment_files=None,
**parameters):
@ -146,6 +146,7 @@ class OrchestrationCloudMixin(_normalize.Normalizer):
files=files)
params = dict(
disable_rollback=not rollback,
tags=tags,
parameters=parameters,
template=template,
files=dict(list(tpl_files.items()) + list(envfiles.items())),

View File

@ -425,6 +425,7 @@ class TestStack(base.TestCase):
'environment': {},
'files': {},
'parameters': {},
'tags': self.stack_tag,
'template': fakes.FAKE_TEMPLATE_CONTENT,
'timeout_mins': 60})),
dict(
@ -446,6 +447,7 @@ class TestStack(base.TestCase):
])
self.cloud.update_stack(
self.stack_name,
tags=self.stack_tag,
template_file=test_template.name)
self.assert_calls()
@ -479,6 +481,7 @@ class TestStack(base.TestCase):
'environment': {},
'files': {},
'parameters': {},
'tags': self.stack_tag,
'template': fakes.FAKE_TEMPLATE_CONTENT,
'timeout_mins': 60})),
dict(
@ -512,6 +515,7 @@ class TestStack(base.TestCase):
])
self.cloud.update_stack(
self.stack_name,
tags=self.stack_tag,
template_file=test_template.name,
wait=True)