From: Itamar Turner-Trauring Date: Mon, 4 Mar 2013 20:06:45 +0000 (-0500) Subject: googlestorage_container.py: Implement DELETE object. X-Git-Url: https://git.rkrishnan.org/%5B/frontends/flags/configuration.rst?a=commitdiff_plain;h=96f3c65f1406c51a3d203af17e8fb0c57f31f303;p=tahoe-lafs%2Ftahoe-lafs.git googlestorage_container.py: Implement DELETE object. --- diff --git a/src/allmydata/storage/backends/cloud/googlestorage/googlestorage_container.py b/src/allmydata/storage/backends/cloud/googlestorage/googlestorage_container.py index 5e91c87f..d272bd3c 100644 --- a/src/allmydata/storage/backends/cloud/googlestorage/googlestorage_container.py +++ b/src/allmydata/storage/backends/cloud/googlestorage/googlestorage_container.py @@ -109,6 +109,24 @@ class GoogleStorageContainer(CommonContainerMixin): d.addCallback(lambda (response, body): body) return d + def _delete_object(self, object_name): + """ + Delete an object from this container. + """ + d = self._auth_client.get_authorization_header() + def _do_delete(auth_header): + request_headers = { + 'Authorization': [auth_header], + "x-goog-api-version": ["2"], + } + url = self._make_object_url(self.URI, object_name) + return self._http_request("DELETE object", 'DELETE', url, request_headers, + body=None, + need_response_body=False) + d.addCallback(_do_delete) + d.addCallback(lambda (response, body): body) + return d + if __name__ == '__main__': from twisted.internet import reactor