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/12/12 20:43:26 UTC

[libcloud] 01/04: Fix attach and detach volume for DO. Volume name instead of id is needed

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 8ad8a68d8b5f3ee06edd5ea9132677d39c7aefc3
Author: mpempekos <sp...@mist.io>
AuthorDate: Tue Dec 10 19:17:59 2019 +0000

    Fix attach and detach volume for DO. Volume name instead of id is needed
---
 libcloud/compute/drivers/digitalocean.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libcloud/compute/drivers/digitalocean.py b/libcloud/compute/drivers/digitalocean.py
index 631f8d9..1ad8c6a 100644
--- a/libcloud/compute/drivers/digitalocean.py
+++ b/libcloud/compute/drivers/digitalocean.py
@@ -424,7 +424,7 @@ class DigitalOcean_v2_NodeDriver(DigitalOcean_v2_BaseDriver,
         :rytpe: ``bool``
         """
         attr = {'type': 'attach', 'droplet_id': node.id,
-                'volume_id': volume.id, 'region': volume.extra['region_slug']}
+                'volume_name': volume.name, 'region': volume.extra['region_slug']}
 
         res = self.connection.request('/v2/volumes/actions',
                                       data=json.dumps(attr), method='POST')
@@ -440,7 +440,7 @@ class DigitalOcean_v2_NodeDriver(DigitalOcean_v2_BaseDriver,
 
         :rtype: ``bool``
         """
-        attr = {'type': 'detach', 'volume_id': volume.id,
+        attr = {'type': 'detach', 'volume_name': volume.name,
                 'region': volume.extra['region_slug']}
 
         responses = []