From: John Mulligan Date: Tue, 9 Jul 2024 18:20:55 +0000 (-0400) Subject: pybind/mgr: add a specific exception for the mgr_pool disabled case X-Git-Tag: v20.0.0~1489^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=96b9564f99f152542c5cea230eaf4292ca2b6548;p=ceph.git pybind/mgr: add a specific exception for the mgr_pool disabled case This can help avoid confusion when debugging why the mgr_pool was not available. Signed-off-by: John Mulligan --- diff --git a/src/pybind/mgr/mgr_module.py b/src/pybind/mgr/mgr_module.py index 1d62d978d0d9..29ddff2ffc2f 100644 --- a/src/pybind/mgr/mgr_module.py +++ b/src/pybind/mgr/mgr_module.py @@ -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()