]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
auth/AuthRegistry: register as an observer
authorSage Weil <sage@redhat.com>
Thu, 21 Feb 2019 19:45:49 +0000 (13:45 -0600)
committerSage Weil <sage@redhat.com>
Thu, 21 Feb 2019 19:45:56 +0000 (13:45 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/auth/AuthRegistry.cc
src/auth/AuthRegistry.h

index f10271800dace28d8ebc0fb1ef0f0a05cb7eac32..241db4a9c733fd46004bed586069474acf68cd39 100644 (file)
 #undef dout_prefix
 #define dout_prefix *_dout << "AuthRegistry(" << this << ") "
 
+AuthRegistry::AuthRegistry(CephContext *cct)
+  : cct(cct)
+{
+  cct->_conf.add_observer(this);
+}
+
+AuthRegistry::~AuthRegistry()
+{
+  cct->_conf.remove_observer(this);
+  for (auto i : authorize_handlers) {
+    delete i.second;
+  }
+}
+
 const char** AuthRegistry::get_tracked_conf_keys() const
 {
   static const char *keys[] = {
@@ -23,6 +37,12 @@ const char** AuthRegistry::get_tracked_conf_keys() const
     "auth_client_required",
     "auth_cluster_required",
     "auth_service_required",
+    "ms_mon_cluster_mode",
+    "ms_mon_service_mode",
+    "ms_mon_client_mode",
+    "ms_cluster_mode",
+    "ms_service_mode",
+    "ms_client_mode",
     "keyring",
     NULL
   };
@@ -338,9 +358,3 @@ AuthAuthorizeHandler *AuthRegistry::get_handler(int peer_type, int method)
   return ah;
 }
 
-AuthRegistry::~AuthRegistry()
-{
-  for (auto i : authorize_handlers) {
-    delete i.second;
-  }
-}
index 72335e1b156f6aa4928725d6ca7dad6777956f44..ce55dca0c8c778145aef1a7f75c7789c03681164 100644 (file)
@@ -38,8 +38,7 @@ class AuthRegistry : public md_config_obs_t {
   void _refresh_config();
 
 public:
-  AuthRegistry(CephContext *cct) : cct(cct) {
-  }
+  AuthRegistry(CephContext *cct);
   ~AuthRegistry();
 
   void refresh_config() {