1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

fix premature exit when RG doesn't exist (#46013)

* fixes #45941
* corrects regression introduced by #26104; when the resource group doesn't exist, the module exits prematurely with an error instead of creating it.
This commit is contained in:
Matt Davis 2018-09-21 16:23:21 -07:00 committed by GitHub
parent fc7e5f16e8
commit 3b52d968e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- azure_rm_deployment - fixed regression that prevents resource group from being created (https://github.com/ansible/ansible/issues/45941)

View file

@ -491,7 +491,8 @@ class AzureRMDeploymentManager(AzureRMModuleBase):
if self.append_tags and self.tags: if self.append_tags and self.tags:
try: try:
rg = self.get_resource_group(self.resource_group_name) # fetch the RG directly (instead of using the base helper) since we don't want to exit if it's missing
rg = self.rm_client.resource_groups.get(self.resource_group_name)
if rg.tags: if rg.tags:
self.tags = dict(self.tags, **rg.tags) self.tags = dict(self.tags, **rg.tags)
except CloudError: except CloudError: