]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/nfs: remove redundant check 45508/head
authorJohn Mulligan <jmulligan@redhat.com>
Mon, 28 Feb 2022 20:46:44 +0000 (15:46 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 17 Mar 2022 14:03:48 +0000 (10:03 -0400)
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 <jmulligan@redhat.com>
(cherry picked from commit dd5a47f83349c8f2b539ba3881f58f5270024cbb)

src/pybind/mgr/nfs/export.py

index 4e1a8251aa7d044bfb7515758e790a9959d20e49..6abaf3f2744de094c6bd56217e7b946cefe0c4db 100644 (file)
@@ -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] = []