Fix poller error handling
This commit is contained in:
parent
14124ef1b8
commit
3f8d04e74b
1 changed files with 2 additions and 2 deletions
|
@ -284,17 +284,17 @@ class AzureRMPublicIPAddress(AzureRMModuleBase):
|
||||||
def create_or_update_pip(self, pip):
|
def create_or_update_pip(self, pip):
|
||||||
try:
|
try:
|
||||||
poller = self.network_client.public_ip_addresses.create_or_update(self.resource_group, self.name, pip)
|
poller = self.network_client.public_ip_addresses.create_or_update(self.resource_group, self.name, pip)
|
||||||
|
pip = self.get_poller_result(poller)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
self.fail("Error creating or updating {0} - {1}".format(self.name, str(exc)))
|
self.fail("Error creating or updating {0} - {1}".format(self.name, str(exc)))
|
||||||
pip = self.get_poller_result(poller)
|
|
||||||
return pip_to_dict(pip)
|
return pip_to_dict(pip)
|
||||||
|
|
||||||
def delete_pip(self):
|
def delete_pip(self):
|
||||||
try:
|
try:
|
||||||
poller = self.network_client.public_ip_addresses.delete(self.resource_group, self.name)
|
poller = self.network_client.public_ip_addresses.delete(self.resource_group, self.name)
|
||||||
|
self.get_poller_result(poller)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
self.fail("Error deleting {0} - {1}".format(self.name, str(exc)))
|
self.fail("Error deleting {0} - {1}".format(self.name, str(exc)))
|
||||||
self.get_poller_result(poller)
|
|
||||||
# Delete returns nada. If we get here, assume that all is well.
|
# Delete returns nada. If we get here, assume that all is well.
|
||||||
self.results['state']['status'] = 'Deleted'
|
self.results['state']['status'] = 'Deleted'
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in a new issue