From 68ed6d078ad5b9edce314d30ecefa243ee889d3a Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 5 Aug 2021 10:42:15 -0400 Subject: [PATCH] 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) --- src/rgw/rgw_rest_role.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_rest_role.cc b/src/rgw/rgw_rest_role.cc index a831d80711e..beb72493a16 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(); } } -- 2.47.3