tests: fix cleanup function

Don't crash when directory to cleanup do not exists.
This commit is contained in:
Marek Marczykowski-Górecki 2017-09-27 02:20:25 +02:00
parent 3075767bb8
commit d8ff85eee6
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -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)