Skip to content

Commit a2192c7

Browse files
committed
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 <[email protected]>
1 parent b3efaae commit a2192c7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/pybind/mgr/nfs/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from object_format import ErrorResponseBase
77
import orchestrator
8+
from orchestrator import NoOrchestrator
89
import cephfs
910
from mgr_util import CephfsClient, open_filesystem
1011

@@ -67,7 +68,11 @@ def available_clusters(mgr: 'Module') -> List[str]:
6768
return value: ['vstart']
6869
'''
6970
# TODO check cephadm cluster list with rados pool conf objects
70-
completion = mgr.describe_service(service_type='nfs')
71+
try:
72+
completion = mgr.describe_service(service_type='nfs')
73+
except NoOrchestrator:
74+
log.exception("No orchestrator configured")
75+
return []
7176
orchestrator.raise_if_exception(completion)
7277
assert completion.result is not None
7378
return [cluster.spec.service_id for cluster in completion.result

0 commit comments

Comments
 (0)