Skip to content

Commit

Permalink
rgw: fix swift cannot disable object versioning
Browse files Browse the repository at this point in the history
we should be able to disable object verioning by removing its X-Versions-Location
metadata header by sending an empty key value. this description can be found at
No.8 in http://docs.openstack.org/user-guide/cli-swift-set-object-versions.html.

Fixes: http://tracker.ceph.com/issues/18852
Signed-off-by: Jing Wenjun <jingwenjun@cmss.chinamobile.com>
  • Loading branch information
Jing-Scott committed Feb 8, 2017
1 parent 00417f0 commit 89ad8de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rgw/rgw_rest_swift.cc
Expand Up @@ -604,7 +604,7 @@ static int get_swift_versioning_settings(
}

std::string vloc = s->info.env->get("HTTP_X_VERSIONS_LOCATION", "");
if (vloc.size()) {
if (s->info.env->exists("HTTP_X_VERSIONS_LOCATION")) {
/* If the Swift's versioning is globally disabled but someone wants to
* enable it for a given container, new version of Swift will generate
* the precondition failed error. */
Expand Down

0 comments on commit 89ad8de

Please sign in to comment.