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>
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)