summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/nfs
diff options
context:
space:
mode:
authorPonnuvel Palaniyappan <pponnuvel@gmail.com>2024-03-02 20:13:36 +0100
committerPonnuvel Palaniyappan <pponnuvel@gmail.com>2024-06-15 10:42:23 +0200
commita2192c73e41e77ec085dd59ff26dc88f77466135 (patch)
tree14918d5ed46fee6414e55b444faab19d3446cf54 /src/pybind/mgr/nfs
parentMerge pull request #57969 from yuvalif/wip-yuval-64305 (diff)
downloadceph-a2192c73e41e77ec085dd59ff26dc88f77466135.tar.xz
ceph-a2192c73e41e77ec085dd59ff26dc88f77466135.zip
mgr/nfs: Don't crash ceph-mgr if NFS clusters are unavailable.
Fixes https://tracker.ceph.com/issues/56246. Fixes https://tracker.ceph.com/issues/59438. Signed-off-by: Ponnuvel Palaniyappan <pponnuvel@gmail.com>
Diffstat (limited to 'src/pybind/mgr/nfs')
-rw-r--r--src/pybind/mgr/nfs/utils.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pybind/mgr/nfs/utils.py b/src/pybind/mgr/nfs/utils.py
index ba3190a9644..269079c1ccf 100644
--- a/src/pybind/mgr/nfs/utils.py
+++ b/src/pybind/mgr/nfs/utils.py
@@ -5,6 +5,7 @@ from typing import List, Tuple, TYPE_CHECKING
from object_format import ErrorResponseBase
import orchestrator
+from orchestrator import NoOrchestrator
import cephfs
from mgr_util import CephfsClient, open_filesystem
@@ -67,7 +68,11 @@ def available_clusters(mgr: 'Module') -> List[str]:
return value: ['vstart']
'''
# TODO check cephadm cluster list with rados pool conf objects
- completion = mgr.describe_service(service_type='nfs')
+ try:
+ completion = mgr.describe_service(service_type='nfs')
+ except NoOrchestrator:
+ log.exception("No orchestrator configured")
+ return []
orchestrator.raise_if_exception(completion)
assert completion.result is not None
return [cluster.spec.service_id for cluster in completion.result