瀏覽代碼

tests: fix cleanup function

Don't crash when directory to cleanup do not exists.
Marek Marczykowski-Górecki 6 年之前
父節點
當前提交
d8ff85eee6
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      qubes/tests/__init__.py

+ 2 - 0
qubes/tests/__init__.py

@@ -865,6 +865,8 @@ class SystemTestCase(QubesTestCase):
                 'qubes_templates_dir'):
             dirpath = os.path.join(qubes.config.qubes_base_dir,
                 qubes.config.system_path[dirspec])
+            if not os.path.exists(dirpath):
+                continue
             for name in os.listdir(dirpath):
                 if name.startswith(prefix):
                     vmnames.add(name)