diff options
author | dparmar18 <dparmar@redhat.com> | 2022-12-01 10:57:32 +0100 |
---|---|---|
committer | dparmar18 <dparmar@redhat.com> | 2022-12-22 15:14:17 +0100 |
commit | cddaef44ea85bf171ee5c87a8f7d2c098a16819b (patch) | |
tree | 9e28051be6881ab71aaed8078ffde9584ee2d2c3 /src/pybind/mgr/nfs | |
parent | Merge PR #49423 into main (diff) | |
download | ceph-cddaef44ea85bf171ee5c87a8f7d2c098a16819b.tar.xz ceph-cddaef44ea85bf171ee5c87a8f7d2c098a16819b.zip |
mgr/nfs: handle bad cluster name during info command
It should say the cluster does not exist
Fixes: https://tracker.ceph.com/issues/58138
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
Diffstat (limited to 'src/pybind/mgr/nfs')
-rw-r--r-- | src/pybind/mgr/nfs/cluster.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pybind/mgr/nfs/cluster.py b/src/pybind/mgr/nfs/cluster.py index b0c82aa606a..2b640754afb 100644 --- a/src/pybind/mgr/nfs/cluster.py +++ b/src/pybind/mgr/nfs/cluster.py @@ -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] |