summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-02-08 13:14:49 -0800
committerSage Weil <sage@inktank.com>2013-02-13 08:47:03 -0800
commitf5eb845a0f7a2c28d3a88a37479bcb34f882f40c (patch)
tree64d420fa6c83ca6b094fce8c8d4dafc562a94cf6
parentf21543f0d88f7bacb69cef3712b0ce087f386e93 (diff)
downloadceph-f5eb845a0f7a2c28d3a88a37479bcb34f882f40c.tar.gz
rgw: change json formatting for swift list container
Fixes: #4048 There is some difference in the way swift formats the xml output and the json output for list container. In xml the entity is named 'name' and in json it is named 'subdir'. Signed-off-by: Yehuda Sadeh <yehuda@inktank.com> (cherry picked from commit 3e4d79fe42dfc3ca70dc4d5d2aff5223f62eb34b)
-rw-r--r--src/rgw/rgw_rest_swift.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc
index 64614b5f59b..34a73633f9a 100644
--- a/src/rgw/rgw_rest_swift.cc
+++ b/src/rgw/rgw_rest_swift.cc
@@ -158,9 +158,17 @@ void RGWListBucket_ObjStore_SWIFT::send_response()
if (name.compare(delimiter) == 0)
goto next;
- s->formatter->open_object_section("object");
- s->formatter->dump_string("name", pref_iter->first);
- s->formatter->close_section();
+ s->formatter->open_object_section("subdir");
+
+ /* swift is a bit inconsistent here */
+ switch (s->format) {
+ case RGW_FORMAT_XML:
+ s->formatter->dump_string("name", pref_iter->first);
+ break;
+ default:
+ s->formatter->dump_string("subdir", pref_iter->first);
+ }
+ s->formatter->close_section();
}
next:
if (do_objs)