]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add minssing admin property when sync user info. 30127/head
authorzhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Wed, 4 Sep 2019 06:46:13 +0000 (14:46 +0800)
committerzhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Wed, 4 Sep 2019 06:46:13 +0000 (14:46 +0800)
Fixes: https://tracker.ceph.com/issues/41643
Signed-off-by: zhang Shaowen <zhangshaowen@cmss.chinamobile.com>
src/rgw/rgw_json_enc.cc
src/rgw/rgw_user.cc

index 6b4756cda9054d7bfb95e68b3f38b75ee787fc9f..67b0bca40d18051070e651c8b59385b2f3ff8cfc 100644 (file)
@@ -483,6 +483,9 @@ void RGWUserInfo::dump(Formatter *f) const
   if (system) { /* no need to show it for every user */
     encode_json("system", (bool)system, f);
   }
+  if (admin) {
+    encode_json("admin", (bool)admin, f);
+  }
   encode_json("default_placement", default_placement.name, f);
   encode_json("default_storage_class", default_placement.storage_class, f);
   encode_json("placement_tags", placement_tags, f);
@@ -561,6 +564,9 @@ void RGWUserInfo::decode_json(JSONObj *obj)
   bool sys = false;
   JSONDecoder::decode_json("system", sys, obj);
   system = (__u8)sys;
+  bool ad = false;
+  JSONDecoder::decode_json("admin", ad, obj);
+  admin = (__u8)ad;
   JSONDecoder::decode_json("default_placement", default_placement.name, obj);
   JSONDecoder::decode_json("default_storage_class", default_placement.storage_class, obj);
   JSONDecoder::decode_json("placement_tags", placement_tags, obj);
index e93ff9ca7ca4f7fd73a1778a14af77edf73fa894..144876db47461ca32f687f66f3373aae8b2d038a 100644 (file)
@@ -743,6 +743,7 @@ static void dump_user_info(Formatter *f, RGWUserInfo &info,
   op_type_to_str(info.op_mask, buf, sizeof(buf));
   encode_json("op_mask", (const char *)buf, f);
   encode_json("system", (bool)info.system, f);
+  encode_json("admin", (bool)info.admin, f);
   encode_json("default_placement", info.default_placement.name, f);
   encode_json("default_storage_class", info.default_placement.storage_class, f);
   encode_json("placement_tags", info.placement_tags, f);