From: Ponnuvel Palaniyappan Date: Sat, 2 Mar 2024 19:13:36 +0000 (+0000) Subject: mgr/nfs: Don't crash ceph-mgr if NFS clusters are unavailable. X-Git-Tag: v20.0.0~1657^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a2192c73e41e77ec085dd59ff26dc88f77466135;p=ceph.git 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 --- 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