From: Pritha Srivastava Date: Fri, 7 Sep 2018 06:58:03 +0000 (+0530) Subject: rgw: Proper result for XML formatting. X-Git-Tag: v14.0.1~113^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fa007156aae3284bd3e9098d8015d7c47123a94a;p=ceph.git rgw: Proper result for XML formatting. Signed-off-by: Pritha Srivastava --- diff --git a/src/rgw/rgw_rest_sts.cc b/src/rgw/rgw_rest_sts.cc index ef6ec70c9d3..91d14830308 100644 --- a/src/rgw/rgw_rest_sts.cc +++ b/src/rgw/rgw_rest_sts.cc @@ -107,9 +107,13 @@ void RGWSTSGetSessionToken::execute() op_ret = std::move(ret); //Dump the output if (op_ret == 0) { + s->formatter->open_object_section("GetSessionTokenResponse"); + s->formatter->open_object_section("GetSessionTokenResult"); s->formatter->open_object_section("Credentials"); creds.dump(s->formatter); s->formatter->close_section(); + s->formatter->close_section(); + s->formatter->close_section(); } } @@ -154,11 +158,15 @@ void RGWSTSAssumeRole::execute() op_ret = std::move(ret); //Dump the output if (op_ret == 0) { + s->formatter->open_object_section("AssumeRoleResponse"); + s->formatter->open_object_section("AssumeRoleResult"); s->formatter->open_object_section("AssumeRole"); assumedRoleUser.dump(s->formatter); creds.dump(s->formatter); encode_json("PackedPolicySize", packedPolicySize , s->formatter); s->formatter->close_section(); + s->formatter->close_section(); + s->formatter->close_section(); } } @@ -181,7 +189,7 @@ int RGWHandler_REST_STS::init(RGWRados *store, { s->dialect = "sts"; - if (int ret = RGWHandler_REST_STS::init_from_header(s, RGW_FORMAT_JSON, true); ret < 0) { + if (int ret = RGWHandler_REST_STS::init_from_header(s, RGW_FORMAT_XML, true); ret < 0) { ldout(s->cct, 10) << "init_from_header returned err=" << ret << dendl; return ret; }