From: Yehuda Sadeh Date: Fri, 8 Feb 2013 21:14:49 +0000 (-0800) Subject: rgw: change json formatting for swift list container X-Git-Tag: v0.57~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3e4d79fe42dfc3ca70dc4d5d2aff5223f62eb34b;p=ceph.git 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 --- diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index 64614b5f59ba..34a73633f9ae 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)