From ab4916e5a736392bade3397ca7d9647a264024bb Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Mon, 28 Feb 2022 15:46:44 -0500 Subject: [PATCH] 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) --- src/pybind/mgr/nfs/export.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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] = [] -- 2.47.3