From: Casey Bodley Date: Thu, 5 Aug 2021 14:42:15 +0000 (-0400) Subject: rgw: change order of xml elements in ListRoles response X-Git-Tag: v16.2.8~103^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=68ed6d078ad5b9edce314d30ecefa243ee889d3a;p=ceph.git rgw: change order of xml elements in ListRoles response 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 (cherry picked from commit 5f1f4212a81a7b124d657d4653de39ee85051964) --- diff --git a/src/rgw/rgw_rest_role.cc b/src/rgw/rgw_rest_role.cc index a831d80711e4..beb72493a16d 100644 --- a/src/rgw/rgw_rest_role.cc +++ b/src/rgw/rgw_rest_role.cc @@ -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(); } }