createiso: Ignore errors when deleting staging dir

JIRA: RHELCMP-975
Signed-off-by: Haibo Lin <hlin@redhat.com>
This commit is contained in:
Haibo Lin 2020-07-07 11:51:37 +08:00
parent d9f111edae
commit b193fa0ab7
1 changed files with 6 additions and 1 deletions

View File

@ -266,7 +266,12 @@ class CreateIsoThread(WorkerThread):
arch, variant, filename=os.path.basename(cmd["iso_path"]), create_dir=False
)
if os.path.exists(staging_dir):
shutil.rmtree(staging_dir)
try:
shutil.rmtree(staging_dir)
except Exception as e:
self.pool.log_warning(
"Failed to clean up staging dir: %s %s" % (staging_dir, str(e))
)
self.pool.log_info("[DONE ] %s" % msg)
if compose.notifier: