azure_rm_securitygroup - fix delete error handling (#56422)

This commit is contained in:
James E. King III 2019-05-14 21:30:23 -04:00 committed by ansibot
parent 8e2bff407a
commit 3170e8b881

View file

@ -741,7 +741,8 @@ class AzureRMSecurityGroup(AzureRMModuleBase):
poller = self.network_client.network_security_groups.delete(resource_group_name=self.resource_group, network_security_group_name=self.name)
result = self.get_poller_result(poller)
except CloudError as exc:
raise Exception("Error deleting security group {0} - {1}".format(self.name, str(exc)))
self.fail("Error deleting security group {0} - {1}".format(self.name, str(exc)))
return result
def convert_asg_to_id(self, rule):