From: Rishabh Dave Date: Tue, 21 Apr 2020 06:38:30 +0000 (+0530) Subject: test_cephfs_shell: catch specific exception instead of catching all X-Git-Tag: wip-pdonnell-testing-20200918.022351~991^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a11b3c0177f65ab8a4dc43bb221aa70070e361e1;p=ceph-ci.git test_cephfs_shell: catch specific exception instead of catching all Signed-off-by: Rishabh Dave --- diff --git a/qa/tasks/cephfs/test_cephfs_shell.py b/qa/tasks/cephfs/test_cephfs_shell.py index 20329ed035a..9799fa455f7 100644 --- a/qa/tasks/cephfs/test_cephfs_shell.py +++ b/qa/tasks/cephfs/test_cephfs_shell.py @@ -178,7 +178,7 @@ class TestMkdir(TestCephFSShell): self.negtest_cephfs_shell_cmd(cmd="mkdir -m -0755 d3") try: self.mount_a.stat('d3') - except: + except CommandFailedError: pass def test_mkdir_with_non_octal_mode(self): @@ -199,7 +199,7 @@ class TestMkdir(TestCephFSShell): self.negtest_cephfs_shell_cmd(cmd="mkdir -m ugx=0755 d5") try: self.mount_a.stat('d5') - except: + except CommandFailedError: pass def test_mkdir_path_without_path_option(self): @@ -209,7 +209,7 @@ class TestMkdir(TestCephFSShell): self.negtest_cephfs_shell_cmd(cmd="mkdir d5/d6/d7") try: self.mount_a.stat('d5/d6/d7') - except: + except CommandFailedError: pass def test_mkdir_path_with_path_option(self): @@ -456,7 +456,7 @@ class TestSnapshots(TestCephFSShell): self.assertEqual("", o) try: o = self.mount_a.stat(sdn) - except: + except CommandFailedError: # snap dir should not exist anymore pass log.info("mount_a output:\n{}".format(o)) @@ -467,7 +467,7 @@ class TestSnapshots(TestCephFSShell): errmsg="'snap1': no such snapshot") try: o = self.mount_a.stat(sdn) - except: + except CommandFailedError: pass log.info("mount_a output:\n{}".format(o)) self.assertNotIn('st_mode', o)