]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
teuthology/test: use correct exception type
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 21 Jan 2022 19:01:22 +0000 (14:01 -0500)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 24 May 2022 00:31:28 +0000 (20:31 -0400)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
teuthology/test/fake_fs.py

index 5432d41416da81107082b07bf5906d2cca2d83fb..c5cb6e4f05efcce746bfffad3716f08a2aded4b6 100644 (file)
@@ -64,8 +64,7 @@ def make_fake_fstools(fake_filesystem):
         subdict = fsdict
         for component in components:
             if component not in subdict:
-                raise FileNotFoundError(
-                    '[Errno 2] No such file or directory: %s' % component)
+                raise FileNotFoundError('[Errno 2] No such file or directory: %s' % component)
             subdict = subdict.get(component)
         return subdict is None or isinstance(subdict, str)
 
@@ -80,8 +79,7 @@ def make_fake_fstools(fake_filesystem):
         subdict = fake_filesystem
         for component in components:
             if component not in subdict:
-                raise IOError(
-                    '[Errno 2] No such file or directory: %s' % component)
+                raise FileNotFoundError('[Errno 2] No such file or directory: %s' % component)
             subdict = subdict.get(component)
         if isinstance(subdict, dict):
             raise IOError('[Errno 21] Is a directory: %s' % path)