From: John Mulligan Date: Mon, 28 Feb 2022 20:46:44 +0000 (-0500) Subject: mgr/nfs: remove redundant check X-Git-Tag: v16.2.8~67^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F45508%2Fhead;p=ceph.git mgr/nfs: remove redundant check Remove the extra check of the cluster id from _apply method. As _apply is a "private" method that should be only called from other private methods that have already validated the cluster_id. It also removes a dependency on the orch-requiring func available_clusters. Signed-off-by: John Mulligan (cherry picked from commit dd5a47f83349c8f2b539ba3881f58f5270024cbb) --- diff --git a/src/pybind/mgr/nfs/export.py b/src/pybind/mgr/nfs/export.py index 4e1a8251aa7d..6abaf3f2744d 100644 --- a/src/pybind/mgr/nfs/export.py +++ b/src/pybind/mgr/nfs/export.py @@ -20,8 +20,7 @@ from orchestrator import NoOrchestrator from mgr_module import NFS_POOL_NAME as POOL_NAME, NFS_GANESHA_SUPPORTED_FSALS from .export_utils import GaneshaConfParser, Export, RawBlock, CephFSFSAL, RGWFSAL -from .exception import NFSException, NFSInvalidOperation, FSNotFound, \ - ClusterNotFound +from .exception import NFSException, NFSInvalidOperation, FSNotFound from .utils import ( CONF_PREFIX, EXPORT_PREFIX, @@ -716,8 +715,6 @@ class ExportMgr: for k in ['path', 'pseudo']: if k not in new_export_dict: raise NFSInvalidOperation(f'Export missing required field {k}') - if cluster_id not in available_clusters(self.mgr): - raise ClusterNotFound() if cluster_id not in self.exports: self.exports[cluster_id] = []