Skip to content

Commit

Permalink
fix azure_rm_hostgroup module
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred-sun committed Dec 29, 2021
1 parent c9baa36 commit f958f45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugins/modules/azure_rm_hostgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def exec_module(self, **kwargs):
elif self.state == 'absent':
changed = True

except CloudError:
except Exception:
if self.state == 'present':
changed = True
else:
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/azure_rm_hostgroup_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def get_item(self):
# get specific host group
try:
item = self.compute_client.dedicated_host_groups.get(self.resource_group, self.name)
except CloudError:
except Exception:
pass

# serialize result
Expand All @@ -151,7 +151,7 @@ def list_resource_group(self):
self.log('List all host groups for resource group - {0}'.format(self.resource_group))
try:
response = self.compute_client.dedicated_host_groups.list_by_resource_group(self.resource_group)
except AzureHttpError as exc:
except Exception as exc:
self.fail("Failed to list for resource group {0} - {1}".format(self.resource_group, str(exc)))

results = []
Expand All @@ -164,7 +164,7 @@ def list_items(self):
self.log('List all host groups for a subscription ')
try:
response = self.compute_client.dedicated_host_groups.list_by_subscription()
except AzureHttpError as exc:
except Exception as exc:
self.fail("Failed to list all items - {0}".format(str(exc)))

results = []
Expand Down

0 comments on commit f958f45

Please sign in to comment.