From bd713e93db0ae980c7c56c16c6d4b241ad9dd837 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Fri, 21 Jan 2022 14:01:22 -0500 Subject: [PATCH] teuthology/test: use correct exception type Signed-off-by: Patrick Donnelly --- teuthology/test/fake_fs.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/teuthology/test/fake_fs.py b/teuthology/test/fake_fs.py index 5432d41416..c5cb6e4f05 100644 --- a/teuthology/test/fake_fs.py +++ b/teuthology/test/fake_fs.py @@ -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) -- 2.39.5