]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: change order of xml elements in ListRoles response 45448/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:35 +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 a831d80711e4c08b34e52941aaa48cf8fa5e5a60..beb72493a16d187a31e7d341cd4ed5c7a35c2513 100644 (file)
@@ -334,9 +334,6 @@ void RGWListRoles::execute(optional_yield y)
 
   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) {
@@ -346,6 +343,9 @@ void RGWListRoles::execute(optional_yield y)
     }
     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();
   }
 }