]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr: add a specific exception for the mgr_pool disabled case
authorJohn Mulligan <jmulligan@redhat.com>
Tue, 9 Jul 2024 18:20:55 +0000 (14:20 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 9 Jul 2024 18:20:55 +0000 (14:20 -0400)
This can help avoid confusion when debugging why the mgr_pool was
not available.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/pybind/mgr/mgr_module.py

index 1d62d978d0d958a9a632d1ac31fc59252622cffe..29ddff2ffc2fa53a97c39ca7304ce41c82f7e05d 100644 (file)
@@ -191,6 +191,13 @@ class MgrDBNotReady(RuntimeError):
     pass
 
 
+class MgrDBNotAllowed(MgrDBNotReady):
+    """A more specific subclass of MgrDBNotReady raised when mgr_pool option
+    disabled.
+    """
+    pass
+
+
 class OSDMap(ceph_module.BasePyOSDMap):
     def get_epoch(self) -> int:
         return self._get_epoch()
@@ -1357,7 +1364,7 @@ class MgrModule(ceph_module.BaseMgrModule, MgrModuleLoggingMixin):
             return self._db
         db_allowed = self.get_ceph_option("mgr_pool")
         if not db_allowed:
-            raise MgrDBNotReady()
+            raise MgrDBNotAllowed()
         self._db = self.open_db()
         if self._db is None:
             raise MgrDBNotReady()