libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erjoh...@apache.org
Subject libcloud git commit: [google compute] bug fix for disk auto-delete
Date Wed, 02 Dec 2015 23:14:40 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk 7e087d6bc -> dc4daeef4


[google compute] bug fix for disk auto-delete


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/dc4daeef
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/dc4daeef
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/dc4daeef

Branch: refs/heads/trunk
Commit: dc4daeef451988f55349e31993f1401770c530f6
Parents: 7e087d6
Author: Eric Johnson <erjohnso@google.com>
Authored: Wed Dec 2 23:14:23 2015 +0000
Committer: Eric Johnson <erjohnso@google.com>
Committed: Wed Dec 2 23:14:23 2015 +0000

----------------------------------------------------------------------
 demos/gce_demo.py               | 2 +-
 libcloud/compute/drivers/gce.py | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/dc4daeef/demos/gce_demo.py
----------------------------------------------------------------------
diff --git a/demos/gce_demo.py b/demos/gce_demo.py
index 790d7d6..c755a18 100755
--- a/demos/gce_demo.py
+++ b/demos/gce_demo.py
@@ -366,7 +366,7 @@ def main_compute():
         display('Creating a new disk:')
         disk_name = '%s-attach-disk' % DEMO_BASE_NAME
         volume = gce.create_volume(10, disk_name)
-        if volume.attach(node_1):
+        if gce.attach_volume(node_1, volume, ex_auto_delete=True):
             display('  Attached %s to %s' % (volume.name, node_1.name))
         display('  Disabled auto-delete for %s on %s' % (volume.name,
                                                          node_1.name))

http://git-wip-us.apache.org/repos/asf/libcloud/blob/dc4daeef/libcloud/compute/drivers/gce.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py
index 8066679..171c11b 100644
--- a/libcloud/compute/drivers/gce.py
+++ b/libcloud/compute/drivers/gce.py
@@ -3392,6 +3392,8 @@ class GCENodeDriver(NodeDriver):
             volume_data['interface'] = ex_interface
         if ex_type:
             volume_data['type'] = ex_type
+        if ex_auto_delete:
+            volume_data['autoDelete'] = ex_auto_delete
 
         volume_data['source'] = ex_source or volume.extra['selfLink']
         volume_data['mode'] = ex_mode or 'READ_WRITE'


Mime
View raw message