]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart_runner: use FileNotFoundError when os.stat() fails 42029/head
authorRishabh Dave <ridave@redhat.com>
Thu, 24 Jun 2021 12:41:13 +0000 (18:11 +0530)
committerRishabh Dave <ridave@redhat.com>
Fri, 25 Jun 2021 15:51:14 +0000 (21:21 +0530)
Fixes: https://tracker.ceph.com/issues/51369
Signed-off-by: Rishabh Dave <ridave@redhat.com>
qa/tasks/vstart_runner.py

index a76601a24dfdbc23beb231f4cbe4087034bc2ed0..845816c976de8f584db8e1e54e9bbac69a56911d 100644 (file)
@@ -1111,13 +1111,9 @@ def teardown_cluster():
 
 
 def clear_old_log():
-    from os import stat
-
     try:
-        stat(logpath)
-    # would need an update when making this py3 compatible. Use FileNotFound
-    # instead.
-    except OSError:
+        os.stat(logpath)
+    except FileNotFoundError:
         return
     else:
         os.remove(logpath)