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: v19.2.3~206^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=03c7a5173282d21c00f5be3da31179d51e7479b8;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 (cherry picked from commit a2192c73e41e77ec085dd59ff26dc88f77466135) --- diff --git a/src/pybind/mgr/nfs/utils.py b/src/pybind/mgr/nfs/utils.py index ba3190a9644a..269079c1ccfb 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