You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2019/07/19 21:04:51 UTC

[libcloud] 07/08: ex_delete_public_ip is just an alias for ex_delete_resource method.

This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit c83b61d8d9fd8214469122d71b73c8b4da2700f7
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Fri Jul 19 23:00:59 2019 +0200

    ex_delete_public_ip is just an alias for ex_delete_resource method.
---
 libcloud/compute/drivers/azure_arm.py | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/libcloud/compute/drivers/azure_arm.py b/libcloud/compute/drivers/azure_arm.py
index 63a2473..f5e4e10 100644
--- a/libcloud/compute/drivers/azure_arm.py
+++ b/libcloud/compute/drivers/azure_arm.py
@@ -1323,13 +1323,14 @@ class AzureNodeDriver(NodeDriver):
         """
         if not isinstance(resource, basestring):
             resource = resource.id
-        self.connection.request(
+        r = self.connection.request(
             resource,
             method='DELETE',
             params={
                 'api-version': RESOURCE_API_VERSION
             },
         )
+        return r.status in [200, 202, 204]
 
     def ex_get_ratecard(self, offer_durable_id, currency='USD',
                         locale='en-US', region='US'):
@@ -1873,16 +1874,7 @@ class AzureNodeDriver(NodeDriver):
         :param public_ip: Public ip address resource to delete
         :type public_ip: `.AzureIPAddress`
         """
-        resource = public_ip.id
-        r = self.connection.request(
-            resource,
-            method='DELETE',
-            params={
-                'api-version': "2019-06-01"
-            },
-        )
-
-        return r.status in [200, 202, 204]
+        return self.ex_delete_resource(public_ip)
 
     def ex_create_network_interface(self, name, subnet, resource_group,
                                     location=None, public_ip=None):