From 54f047fc2a9bf4fed7c218879d7d0cd8d3dd51a0 Mon Sep 17 00:00:00 2001 From: Yu Ming Zhu Date: Jul 22 2020 03:29:13 +0000 Subject: TaskManager: clean both result and results dirs fixes: #1988 --- diff --git a/koji/daemon.py b/koji/daemon.py index 7897713..4edf6d7 100644 --- a/koji/daemon.py +++ b/koji/daemon.py @@ -767,10 +767,13 @@ class TaskManager(object): self.logger.info("%s: clearing rootdir" % desc2) for fn in flist: safe_rmtree("%s/%s" % (rootdir, fn), unmount=True, strict=False) - resultdir = "%s/result" % d - if os.path.isdir(resultdir): - self.logger.info("%s: clearing resultdir" % desc2) - safe_rmtree(resultdir, unmount=True, strict=False) + # bootstrap's resultdir is 'results', so we try the best to remove both + # 'result(s)' dirs + for r in ('result', 'results'): + resultdir = "%s/%s" % (d, r) + if os.path.isdir(resultdir): + self.logger.info("%s: clearing resultdir: %s" % (desc2, resultdir)) + safe_rmtree(resultdir, unmount=True, strict=False) else: self.logger.debug("Recent buildroot: %s: %i seconds" % (desc, age)) self.logger.debug("Local buildroots: %d" % len(local_br))