]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: set attrs on various list bucket xml results (swift)
authorYehuda Sadeh <yehuda@inktank.com>
Fri, 22 Feb 2013 23:04:37 +0000 (15:04 -0800)
committerYehuda Sadeh <yehuda@inktank.com>
Fri, 8 Mar 2013 17:03:38 +0000 (09:03 -0800)
Fixes: #4247
The list buckets operation was missing some attrs on the different
xml result entities. This fixes it.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 4384e59ad046afc9ec53a2d2f1fff6a86e645505)

src/rgw/rgw_rest_swift.cc

index 34a73633f9ae284a5dade25c42ef075ffd9b7194..40712e281648f12ea2da64c8ab4824ae3d43e38d 100644 (file)
@@ -112,7 +112,7 @@ void RGWListBucket_ObjStore_SWIFT::send_response()
 
   dump_start(s);
 
-  s->formatter->open_array_section("container");
+  s->formatter->open_array_section_with_attrs("container", FormatterAttrs("name", s->bucket.name.c_str(), NULL));
 
   while (iter != objs.end() || pref_iter != common_prefixes.end()) {
     bool do_pref = false;
@@ -158,15 +158,15 @@ void RGWListBucket_ObjStore_SWIFT::send_response()
       if (name.compare(delimiter) == 0)
         goto next;
 
-        s->formatter->open_object_section("subdir");
+        s->formatter->open_object_section_with_attrs("subdir", FormatterAttrs("name", name.c_str(), NULL));
 
         /* swift is a bit inconsistent here */
         switch (s->format) {
           case RGW_FORMAT_XML:
-            s->formatter->dump_string("name", pref_iter->first);
+            s->formatter->dump_string("name", name);
             break;
           default:
-            s->formatter->dump_string("subdir", pref_iter->first);
+            s->formatter->dump_string("subdir", name);
         }
         s->formatter->close_section();
     }