From a34b3cad0ffda4ab6183a0fa05ca699f7a342806 Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Thu, 15 Oct 2020 15:54:53 +0200 Subject: [PATCH] rgw: role: md handler get_meta_obj defn Signed-off-by: Abhishek Lekshmanan (cherry picked from commit 59b072ad7f66648fe6cfce5e175113cde60058b0) --- src/rgw/rgw_role.cc | 16 ++++++++++++++++ src/rgw/rgw_role.h | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/src/rgw/rgw_role.cc b/src/rgw/rgw_role.cc index 18760ea37bc..0c0946d5301 100644 --- a/src/rgw/rgw_role.cc +++ b/src/rgw/rgw_role.cc @@ -588,6 +588,22 @@ void RGWRoleCompleteInfo::decode_json(JSONObj *obj) has_attrs = JSONDecoder::decode_json("attrs", attrs, obj); } + +RGWMetadataObject *RGWRoleMetadataHandler::get_meta_obj(JSONObj *jo, + const obj_version& objv, + const ceph::real_time& mtime) +{ + RGWRoleCompleteInfo rci; + + try { + decode_json_obj(rci, jo); + } catch (JSONDecoder:: err& e) { + return nullptr; + } + + return new RGWRoleMetadataObject(rci, objv, mtime); +} + int RGWRoleMetadataHandler::do_get(RGWSI_MetaBackend_Handler::Op *op, std::string& entry, RGWMetadataObject **obj, diff --git a/src/rgw/rgw_role.h b/src/rgw/rgw_role.h index 80c0b2a912c..d0cbb072f0c 100644 --- a/src/rgw/rgw_role.h +++ b/src/rgw/rgw_role.h @@ -186,6 +186,12 @@ public: RGWRoleMetadataHandler(RGWSI_Role *role_svc); + std::string get_type() final { return "roles"; } + + RGWMetadataObject *get_meta_obj(JSONObj *jo, + const obj_version& objv, + const ceph::real_time& mtime); + int do_get(RGWSI_MetaBackend_Handler::Op *op, std::string& entry, RGWMetadataObject **obj, -- 2.47.3