]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/nfs: remove unused export_cluster_checker function
authorJohn Mulligan <jmulligan@redhat.com>
Sat, 7 May 2022 14:22:37 +0000 (10:22 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 12 Jan 2023 18:44:11 +0000 (13:44 -0500)
This decorator is no longer needed as equivalent functionality is
handled internally by the class.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/pybind/mgr/nfs/export.py

index b2a13f39aa0d100c0616c012127bc593c4c71419..2dbd35cac20fca5759e3285d85969b99bdfbbef8 100644 (file)
@@ -56,25 +56,6 @@ def known_cluster_ids(mgr: 'Module') -> Set[str]:
     return clusters
 
 
-def export_cluster_checker(func: FuncT) -> FuncT:
-    def cluster_check(
-            export: 'ExportMgr',
-            *args: Any,
-            **kwargs: Any
-    ) -> Tuple[int, str, str]:
-        """
-        This method checks if cluster exists
-        """
-        clusters = known_cluster_ids(export.mgr)
-        cluster_id: str = kwargs['cluster_id']
-        log.debug("checking for %r in known nfs clusters: %r",
-                  cluster_id, clusters)
-        if cluster_id not in clusters:
-            return -errno.ENOENT, "", "Cluster does not exist"
-        return func(export, *args, **kwargs)
-    return cast(FuncT, cluster_check)
-
-
 def exception_handler(
         exception_obj: Exception,
         log_msg: str = ""