lib/fog/azurerm/requests/network/delete_public_ip.rb in fog-azure-rm-0.0.4 vs lib/fog/azurerm/requests/network/delete_public_ip.rb in fog-azure-rm-0.0.5
- old
+ new
@@ -4,17 +4,15 @@
# Real class for Network Request
class Real
def delete_public_ip(resource_group, name)
Fog::Logger.debug "Deleting PublicIP #{name} from Resource Group #{resource_group}."
begin
- promise = @network_client.public_ipaddresses.delete(resource_group, name)
- promise.value!
- Fog::Logger.debug "PublicIP #{name} Deleted Successfully."
- true
+ @network_client.public_ipaddresses.delete(resource_group, name)
rescue MsRestAzure::AzureOperationError => e
- msg = "Exception deleting Public IP #{name} in Resource Group: #{resource_group}. #{e.body['error']['message']}"
- raise msg
+ raise_azure_exception(e, "Deleting PublicIP #{name} from Resource Group #{resource_group}")
end
+ Fog::Logger.debug "PublicIP #{name} Deleted Successfully."
+ true
end
end
# Mock class for Network Request
class Mock