Skip to content

Commit

Permalink
Do not disregard tags when updating stacks
Browse files Browse the repository at this point in the history
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: ansible/ansible#53757

Change-Id: I59e7c47b8c01f96ec561b8bd153804bac5f21800
Story: 2005226
Task: 30008
  • Loading branch information
brtkwr authored and priteau committed Mar 27, 2019
1 parent 1a4ed82 commit a0ec8ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openstack/cloud/_orchestration.py
Expand Up @@ -110,7 +110,7 @@ def update_stack(
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):
Expand Down Expand Up @@ -146,6 +146,7 @@ def update_stack(
files=files)
params = dict(
disable_rollback=not rollback,
tags=tags,
parameters=parameters,
template=template,
files=dict(list(tpl_files.items()) + list(envfiles.items())),
Expand Down
4 changes: 4 additions & 0 deletions openstack/tests/unit/cloud/test_stack.py
Expand Up @@ -425,6 +425,7 @@ def test_update_stack(self):
'environment': {},
'files': {},
'parameters': {},
'tags': self.stack_tag,
'template': fakes.FAKE_TEMPLATE_CONTENT,
'timeout_mins': 60})),
dict(
Expand All @@ -446,6 +447,7 @@ def test_update_stack(self):
])
self.cloud.update_stack(
self.stack_name,
tags=self.stack_tag,
template_file=test_template.name)

self.assert_calls()
Expand Down Expand Up @@ -479,6 +481,7 @@ def test_update_stack_wait(self):
'environment': {},
'files': {},
'parameters': {},
'tags': self.stack_tag,
'template': fakes.FAKE_TEMPLATE_CONTENT,
'timeout_mins': 60})),
dict(
Expand Down Expand Up @@ -512,6 +515,7 @@ def test_update_stack_wait(self):
])
self.cloud.update_stack(
self.stack_name,
tags=self.stack_tag,
template_file=test_template.name,
wait=True)

Expand Down

0 comments on commit a0ec8ef

Please sign in to comment.