From d515c935d20a31546c3ca2e0220a48f73157dbae 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 473e670d02ba..662f997f3658 100644 --- a/src/rgw/rgw_rest_role.cc +++ b/src/rgw/rgw_rest_role.cc @@ -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(); } } -- 2.47.3