From: Dunrong Huang Date: Wed, 3 Feb 2016 07:59:24 +0000 (+0800) Subject: rgw: support json format output for rados-admin policy command X-Git-Tag: v10.1.0~166^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dd24f517583c0334541b24bb1f9aafa86cf61968;p=ceph.git rgw: support json format output for rados-admin policy command when use rados-admin to get policy with parameter --format=json: $ radosgw-admin policy --bucket=m8x --format=json policy information with json format should be output. Signed-off-by: Dunrong Huang --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 8ff4044174dd..d7ba50cccf2b 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -3462,9 +3462,10 @@ int main(int argc, char **argv) } if (opt_cmd == OPT_POLICY) { - int ret = RGWBucketAdminOp::get_policy(store, bucket_op, cout); - if (ret >= 0) { - cout << std::endl; + int ret = RGWBucketAdminOp::get_policy(store, bucket_op, f); + if (ret < 0) { + cerr << "ERROR: failed to get policy: " << cpp_strerror(-ret) << std::endl; + return -ret; } }