From b6aafc2759bcb2248f337d7589296eed42cd5453 Mon Sep 17 00:00:00 2001 From: yuliyang Date: Thu, 11 May 2017 00:26:57 +0800 Subject: [PATCH] rgw-multisite: fix the problem of rgw website configure 'RedirectAllRequestsTo' failed to sync to slave zone Signed-off-by: yuliyang --- src/rgw/rgw_json_enc.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_json_enc.cc b/src/rgw/rgw_json_enc.cc index 2a183b5919583..25b5fbdf4e3c5 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); -- 2.39.5