Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Send 'scrub_data' parameter when destroying a DigitalOcean node.

Part of LIBCLOUD-487.
  • Loading branch information...
commit 4449e165a00756dc61430e6ad9520f005b045d29 1 parent df38b3b
@Kami Kami authored
View
5 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
View
4 libcloud/compute/drivers/digitalocean.py
@@ -122,7 +122,9 @@ def reboot_node(self, node):
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):
View
5 libcloud/test/compute/test_digitalocean.py
@@ -25,7 +25,7 @@
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 @@ def test_ex_destroy_ssh_key(self):
self.assertTrue(result)
-class DigitalOceanMockHttp(MockHttp):
+class DigitalOceanMockHttp(MockHttpTestCase):
fixtures = ComputeFileFixtures('digitalocean')
def _regions(self, method, url, body, headers):
@@ -129,6 +129,7 @@ def _droplets_119461_reboot(self, method, url, body, headers):
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])
Please sign in to comment.
Something went wrong with that request. Please try again.