From: Jeff Layton Date: Mon, 11 Feb 2019 16:24:23 +0000 (-0500) Subject: mgr/volumes: properly handle NoOrchestrator exception X-Git-Tag: v14.1.0~132^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a94cfa878aee1b3d0b79b0106a9624025a6e43e9;p=ceph.git mgr/volumes: properly handle NoOrchestrator exception Signed-off-by: Jeff Layton --- diff --git a/src/pybind/mgr/volumes/module.py b/src/pybind/mgr/volumes/module.py index 4d67c207045..d1eff8e15d2 100644 --- a/src/pybind/mgr/volumes/module.py +++ b/src/pybind/mgr/volumes/module.py @@ -168,7 +168,7 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule): try: completion = self.add_stateless_service("mds", spec) self._orchestrator_wait([completion]) - except ImportError: + except (ImportError, orchestrator.NoOrchestrator): return 0, "", "Volume created successfully (no MDS daemons created)" except Exception as e: # Don't let detailed orchestrator exceptions (python backtraces) @@ -249,7 +249,7 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule): try: completion = self.remove_stateless_service("mds", vol_name) self._orchestrator_wait([completion]) - except ImportError: + except (ImportError, orchestrator.NoOrchestrator): self.log.warning("No orchestrator, not tearing down MDS daemons") except Exception as e: # Don't let detailed orchestrator exceptions (python backtraces)