From: yuliyang Date: Wed, 10 May 2017 16:26:57 +0000 (+0800) Subject: rgw-multisite: fix the problem of rgw website configure 'RedirectAllRequestsTo' faile... X-Git-Tag: v12.1.0~101^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b6aafc2759bcb2248f337d7589296eed42cd5453;p=ceph.git rgw-multisite: fix the problem of rgw website configure 'RedirectAllRequestsTo' failed to sync to slave zone Signed-off-by: yuliyang --- diff --git a/src/rgw/rgw_json_enc.cc b/src/rgw/rgw_json_enc.cc index 2a183b59195..25b5fbdf4e3 100644 --- a/src/rgw/rgw_json_enc.cc +++ b/src/rgw/rgw_json_enc.cc @@ -698,12 +698,17 @@ void RGWBWRoutingRules::decode_json(JSONObj *obj) { void RGWBucketWebsiteConf::dump(Formatter *f) const { - encode_json("index_doc_suffix", index_doc_suffix, f); - encode_json("error_doc", error_doc, f); - encode_json("routing_rules", routing_rules, f); + if (!redirect_all.hostname.empty()) { + encode_json("redirect_all", redirect_all, f); + } else { + encode_json("index_doc_suffix", index_doc_suffix, f); + encode_json("error_doc", error_doc, f); + encode_json("routing_rules", routing_rules, f); + } } void RGWBucketWebsiteConf::decode_json(JSONObj *obj) { + JSONDecoder::decode_json("redirect_all", redirect_all, obj); JSONDecoder::decode_json("index_doc_suffix", index_doc_suffix, obj); JSONDecoder::decode_json("error_doc", error_doc, obj); JSONDecoder::decode_json("routing_rules", routing_rules, obj);