Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'deleted_key_info' of https://github.com/tpodowd/boto in…

…to tpodowd-deleted_key_info
  • Loading branch information...
commit ee4e4608df6b83e8915f46761f4c2039d6850281 2 parents 0e2639c + 21e3001
@garnaat garnaat authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 boto/s3/bucket.py
View
11 boto/s3/bucket.py
@@ -565,6 +565,11 @@ def delete_key(self, key_name, headers=None,
This value is required anytime you are
deleting versioned objects from a bucket
that has the MFADelete option on the bucket.
+
+ :rtype: :class:`boto.s3.key.Key` or subclass
+ :returns: A key object holding information on what was deleted.
+ The Caller can see if a delete_marker was created or
+ removed and what version_id the delete created or removed.
"""
provider = self.connection.provider
if version_id:
@@ -582,6 +587,12 @@ def delete_key(self, key_name, headers=None,
if response.status != 204:
raise provider.storage_response_error(response.status,
response.reason, body)
+ else:
+ # return a key object with information on what was deleted.
+ k = self.key_class(self)
+ k.name = key_name
+ k.handle_version_headers(response)
+ return k
def copy_key(self, new_key_name, src_bucket_name,
src_key_name, metadata=None, src_version_id=None,
Please sign in to comment.
Something went wrong with that request. Please try again.