can not delete only metada of container
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
Undecided
|
Tom Fifield |
Bug Description
We can not delete only metada of container.
Example is case of StaticWeb:
container=web
file=web/index.html
curl -v -X GET -H 'X-Storage-Token: AUTH_tk168fccd6
< HTTP/1.1 200 OK
< X-Container-
< X-Container-
< X-Timestamp: 1347270749.13087
< X-Container-Read: .r:*
< X-Container-
< X-Container-
< Accept-Ranges: bytes
< Content-Length: 11
< Content-Type: text/plain; charset=utf-8
< Date: Tue, 11 Sep 2012 09:15:35 GMT
index.html
Now I want to delete 'X-Container-
I have no choice but to delete container 'web'.
I can only delete all of container 'web' and metadata.
My patch is very simple fix.
If I set 'deleteme' to metadata value, then delete its metadata item
curl -v -X PUT -H 'X-Container-
< HTTP/1.1 200 OK
< X-Container-
< X-Container-
< X-Timestamp: 1347270749.13087
< X-Container-Read: .r:*
< X-Container-
< Accept-Ranges: bytes
< Content-Length: 11
< Content-Type: text/plain; charset=utf-8
< Date: Tue, 11 Sep 2012 09:27:41 GMT
index.html
Thank you.
=== here is patch
diff --git a/swift/
index 6b30db4..f6fd972 100644
--- a/swift/
+++ b/swift/
@@ -588,6 +588,9 @@ class DatabaseBroker(
if key not in md or timestamp > md[key][1]:
+ ## if remove metadata item then set 'deleteme' to its header value
+ if value == 'deleteme':
+ del md[key]
===
description: | updated |
Changed in swift: | |
milestone: | none → 1.7.5 |
status: | Fix Committed → Fix Released |
If you want delete a custom metadata, just POST a 'X-Remove- Container- Meta-Web- Index: anything' or 'X-Remove- Container- Meta-Web- Index: '.
The curl can't transfer an empty header, so use the 'X-Remove- Container- Meta-Web- Index: anything'.