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: v17.2.8~175^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f405b82b7e41c6e22e5ea00fbedfc7e822ed70d6;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 110aa3a94ed..b90bb3c75d5 100644 --- a/src/pybind/mgr/nfs/utils.py +++ b/src/pybind/mgr/nfs/utils.py @@ -4,6 +4,7 @@ import stat from typing import List, TYPE_CHECKING import orchestrator +from orchestrator import NoOrchestrator import cephfs from mgr_util import CephfsClient, open_filesystem @@ -42,7 +43,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