From 29224b02ff3fa94ce3f67ebb5863ad90fa6c4bbc Mon Sep 17 00:00:00 2001 From: Haibo Lin Date: Thu, 22 Aug 2019 14:24:01 +0800 Subject: [PATCH] Delete lookaside cache dir If --lookaside option passed to repoclosure command, extra cache dir will be created and it should be deleted too. JIRA: COMPOSE-2565 Signed-off-by: Haibo Lin --- pungi/phases/test.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pungi/phases/test.py b/pungi/phases/test.py index a46b7960..fdd6bb07 100644 --- a/pungi/phases/test.py +++ b/pungi/phases/test.py @@ -111,6 +111,11 @@ def _run_repoclosure_cmd(compose, repos, lookaside, arches, logfile): if os.path.isdir(cache_dir): shutil.rmtree(cache_dir) + for repo_id in lookaside.keys(): + cache_dir = os.path.join(top_cache_dir, repo_id) + if os.path.isdir(cache_dir): + shutil.rmtree(cache_dir) + def check_image_sanity(compose): """