]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: split RGWRole into an Info Class containing members
authorAbhishek Lekshmanan <abhishek@suse.com>
Thu, 24 Sep 2020 10:58:22 +0000 (12:58 +0200)
committerPritha Srivastava <prsrivas@redhat.com>
Thu, 1 Sep 2022 07:47:22 +0000 (13:17 +0530)
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit 0cabcf6b8e810ecd3701129ad399b97a4d14b7e2)

src/rgw/rgw_role.cc
src/rgw/rgw_role.h
src/rgw/services/svc_role.h

index fe028f315971ea1a7f18f2e68ba1ffacf8f8c5b6..af7f7f6f8fd0deac7296a634dd4f620cafd64691 100644 (file)
@@ -107,7 +107,7 @@ int RGWRole::delete_policy(const DoutPrefixProvider* dpp, const string& policy_n
   } else {
     perm_policy_map.erase(it);
   }
-  return 0;
+    return 0;
 }
 
 void RGWRole::dump(Formatter *f) const
@@ -176,12 +176,11 @@ bool RGWRole::validate_input(const DoutPrefixProvider* dpp)
   return true;
 }
 
-void RGWRole::extract_name_tenant(const std::string& str)
-{
-  size_t pos = str.find('$');
-  if (pos != std::string::npos) {
+void RGWRole::extract_name_tenant(const std::string& str) {
+  if (auto pos = str.find('$');
+      pos != std::string::npos) {
     tenant = str.substr(0, pos);
-    name = str.substr(pos + 1);
+    name = str.substr(pos+1);
   }
 }
 
index ce29b9d74152ed7c2386b263c5c9ee699f8ec5ac..1523b6ecda396d9fd909a943fc4355a577c76532 100644 (file)
@@ -63,7 +63,7 @@ public:
     tags(std::move(tags)) {
     if (this->path.empty())
       this->path = "/";
-    extract_name_tenant(this->name);
+    extract_name_tenant(name);
     if (max_session_duration_str.empty()) {
       max_session_duration = SESSION_DURATION_MIN;
     } else {
index 013c0ebb983749091efdc6f774188a8b7b02431a..c33da97c1b842671ab10541b2909b393ffbf07a8 100644 (file)
@@ -19,8 +19,6 @@
 #include "rgw/rgw_role.h"
 #include "svc_meta_be.h"
 
-class RGWRole;
-
 class RGWSI_Role: public RGWServiceInstance
 {
  public: