Skip to content

Commit a338e04

Browse files
authored
Merge pull request ceph#56876 from pponnuvel/no_crash_if_nfs_unavailable
mgr/nfs: Don't crash ceph-mgr if NFS clusters are unavailable. Reviewed-by: Avan Thakkar <[email protected]> Reviewed-by: Ankush Behl <[email protected]>
2 parents ae0bac9 + a2192c7 commit a338e04

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)