mirror of
https://github.com/ceph/ceph
synced 2025-01-02 00:52:22 +00:00
Merge PR #49172 into main
* refs/pull/49172/head: qa/test_nfs: added testcase test_non_existent_cluster mgr/nfs: handle bad cluster name during info command Reviewed-by: Venky Shankar <vshankar@redhat.com>
This commit is contained in:
commit
7443a451f4
@ -730,3 +730,12 @@ class TestNFS(MgrTestCase):
|
||||
exec_cmd_invalid('export', 'info')
|
||||
exec_cmd_invalid('export', 'info', 'clusterid')
|
||||
exec_cmd_invalid('export', 'apply')
|
||||
|
||||
def test_non_existent_cluster(self):
|
||||
"""
|
||||
Test that cluster info doesn't throw junk data for non-existent cluster
|
||||
"""
|
||||
cluseter_ls = self._nfs_cmd('cluster', 'ls')
|
||||
self.assertNotIn('foo', cluseter_ls, 'cluster foo exists')
|
||||
cluster_info = self._nfs_cmd('cluster', 'info', 'foo')
|
||||
self.assertIn('cluster does not exist', cluster_info)
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user