libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [libcloud] branch trunk updated: Revert my previous change since IP address operations require API version >= 2018.
Date Fri, 19 Jul 2019 21:14:16 GMT
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


The following commit(s) were added to refs/heads/trunk by this push:
     new 52195a6  Revert my previous change since IP address operations require API version
>= 2018.
52195a6 is described below

commit 52195a6e9d15a31d0668d90111542435d638b62b
Author: Tomaz Muraus <tomaz@tomaz.me>
AuthorDate: Fri Jul 19 23:10:32 2019 +0200

    Revert my previous change since IP address operations require API
    version >= 2018.
---
 libcloud/compute/drivers/azure_arm.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/libcloud/compute/drivers/azure_arm.py b/libcloud/compute/drivers/azure_arm.py
index f5e4e10..e992f33 100644
--- a/libcloud/compute/drivers/azure_arm.py
+++ b/libcloud/compute/drivers/azure_arm.py
@@ -1874,7 +1874,18 @@ class AzureNodeDriver(NodeDriver):
         :param public_ip: Public ip address resource to delete
         :type public_ip: `.AzureIPAddress`
         """
-        return self.ex_delete_resource(public_ip)
+        # NOTE: This operation requires API version 2018-11-01 so
+        # "ex_delete_resource" won't for for deleting an IP address
+        resource = public_ip.id
+        r = self.connection.request(
+            resource,
+            method='DELETE',
+            params={
+                'api-version': '2019-06-01'
+            },
+        )
+
+        return r.status in [200, 202, 204]
 
     def ex_create_network_interface(self, name, subnet, resource_group,
                                     location=None, public_ip=None):


Mime
View raw message