From 3f8d04e74b6e80b364588de064d16750de713d59 Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Thu, 21 Apr 2016 17:55:24 -0400 Subject: [PATCH] Fix poller error handling --- cloud/azure/azure_rm_publicipaddress.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/azure/azure_rm_publicipaddress.py b/cloud/azure/azure_rm_publicipaddress.py index ffed931d66b..bfab0137f32 100644 --- a/cloud/azure/azure_rm_publicipaddress.py +++ b/cloud/azure/azure_rm_publicipaddress.py @@ -284,17 +284,17 @@ class AzureRMPublicIPAddress(AzureRMModuleBase): def create_or_update_pip(self, pip): try: 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: self.fail("Error creating or updating {0} - {1}".format(self.name, str(exc))) - pip = self.get_poller_result(poller) return pip_to_dict(pip) def delete_pip(self): try: poller = self.network_client.public_ip_addresses.delete(self.resource_group, self.name) + self.get_poller_result(poller) except Exception as 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. self.results['state']['status'] = 'Deleted' return True