]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: change order of xml elements in ListRoles response 45449/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 5 Aug 2021 14:42:15 +0000 (10:42 -0400)
committerCory Snyder <csnyder@iland.com>
Wed, 16 Mar 2022 17:23:52 +0000 (13:23 -0400)
one or more AWS sdks fail to parse our response because they expect
ListRolesResult to come first. not really an rgw bug, but it's easy
enough to fix

Fixes: https://tracker.ceph.com/issues/52027
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 5f1f4212a81a7b124d657d4653de39ee85051964)

src/rgw/rgw_rest_role.cc

index 473e670d02ba4b382444ae3221537404806dccdf..662f997f3658552ba0b1ed0629dc338a81e25f74 100644 (file)
@@ -332,9 +332,6 @@ void RGWListRoles::execute()
 
   if (op_ret == 0) {
     s->formatter->open_array_section("ListRolesResponse");
-    s->formatter->open_object_section("ResponseMetadata");
-    s->formatter->dump_string("RequestId", s->trans_id);
-    s->formatter->close_section();
     s->formatter->open_array_section("ListRolesResult");
     s->formatter->open_object_section("Roles");
     for (const auto& it : result) {
@@ -344,6 +341,9 @@ void RGWListRoles::execute()
     }
     s->formatter->close_section();
     s->formatter->close_section();
+    s->formatter->open_object_section("ResponseMetadata");
+    s->formatter->dump_string("RequestId", s->trans_id);
+    s->formatter->close_section();
     s->formatter->close_section();
   }
 }