]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/nfs: handle bad cluster name during info command
authordparmar18 <dparmar@redhat.com>
Thu, 1 Dec 2022 09:57:32 +0000 (15:27 +0530)
committerdparmar18 <dparmar@redhat.com>
Thu, 22 Dec 2022 14:14:17 +0000 (19:44 +0530)
It should say the cluster does not exist

Fixes: https://tracker.ceph.com/issues/58138
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
src/pybind/mgr/nfs/cluster.py

index b0c82aa606a5d21c1364d142d5585fac5b1dba7d..2b640754afb1cb0dc966f958dd56693e761952aa 100644 (file)
@@ -203,6 +203,8 @@ class NFSCluster:
 
     def show_nfs_cluster_info(self, cluster_id: Optional[str] = None) -> Tuple[int, str, str]:
         try:
+            if cluster_id and cluster_id not in available_clusters(self.mgr):
+                raise ClusterNotFound()
             info_res = {}
             if cluster_id:
                 cluster_ls = [cluster_id]