libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject git commit: Send 'scrub_data' parameter when destroying a DigitalOcean node.
Date Mon, 30 Dec 2013 21:58:44 GMT
Updated Branches:
  refs/heads/trunk df38b3b70 -> 4449e165a


Send 'scrub_data' parameter when destroying a DigitalOcean node.

Part of LIBCLOUD-487.


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

Branch: refs/heads/trunk
Commit: 4449e165a00756dc61430e6ad9520f005b045d29
Parents: df38b3b
Author: Tomaz Muraus <tomaz@apache.org>
Authored: Mon Dec 30 22:38:23 2013 +0100
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Mon Dec 30 22:51:59 2013 +0100

----------------------------------------------------------------------
 CHANGES                                    | 5 +++++
 libcloud/compute/drivers/digitalocean.py   | 4 +++-
 libcloud/test/compute/test_digitalocean.py | 5 +++--
 3 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/4449e165/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index a394d3a..847dcd8 100644
--- a/CHANGES
+++ b/CHANGES
@@ -153,6 +153,11 @@ Changes with Apache Libcloud in development
      (LIBCLOUD-481, GITHUB-215)
      [Chris DeRamus]
 
+   - Send "scrub_data" query parameter when destroying a DigitalOcean node.
+     This will cause disk to be scrubbed (overwritten with 0's) when destroying
+     a node. (LIBCLOUD-487)
+     [Tomaz Muraus]
+
   *) Storage
 
     - Allow user to specify 'Content-Disposition' header in the CloudFiles

http://git-wip-us.apache.org/repos/asf/libcloud/blob/4449e165/libcloud/compute/drivers/digitalocean.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/digitalocean.py b/libcloud/compute/drivers/digitalocean.py
index 426b019..4db0e2f 100644
--- a/libcloud/compute/drivers/digitalocean.py
+++ b/libcloud/compute/drivers/digitalocean.py
@@ -122,7 +122,9 @@ class DigitalOceanNodeDriver(NodeDriver):
         return res.status == httplib.OK
 
     def destroy_node(self, node):
-        res = self.connection.request('/droplets/%s/destroy/' % (node.id))
+        params = {'scrub_data': 'true'}
+        res = self.connection.request('/droplets/%s/destroy/' % (node.id),
+                                      params=params)
         return res.status == httplib.OK
 
     def ex_list_ssh_keys(self):

http://git-wip-us.apache.org/repos/asf/libcloud/blob/4449e165/libcloud/test/compute/test_digitalocean.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_digitalocean.py b/libcloud/test/compute/test_digitalocean.py
index d96d22e..043e610 100644
--- a/libcloud/test/compute/test_digitalocean.py
+++ b/libcloud/test/compute/test_digitalocean.py
@@ -25,7 +25,7 @@ from libcloud.utils.py3 import httplib
 from libcloud.common.types import InvalidCredsError
 from libcloud.compute.drivers.digitalocean import DigitalOceanNodeDriver
 
-from libcloud.test import MockHttp
+from libcloud.test import MockHttpTestCase
 from libcloud.test.file_fixtures import ComputeFileFixtures
 from libcloud.test.secrets import DIGITAL_OCEAN_PARAMS
 
@@ -103,7 +103,7 @@ class DigitalOceanTests(unittest.TestCase):
         self.assertTrue(result)
 
 
-class DigitalOceanMockHttp(MockHttp):
+class DigitalOceanMockHttp(MockHttpTestCase):
     fixtures = ComputeFileFixtures('digitalocean')
 
     def _regions(self, method, url, body, headers):
@@ -129,6 +129,7 @@ class DigitalOceanMockHttp(MockHttp):
 
     def _droplets_119461_destroy(self, method, url, body, headers):
         # destroy_node
+        self.assertUrlContainsQueryParams(url, {'scrub_data': 'true'})
         body = self.fixtures.load('destroy_node.json')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 


Mime
View raw message