[dak/master] only unlink queue files that exist
---
dak/process_policy.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dak/process_policy.py b/dak/process_policy.py
index ecaeeac..3efab0d 100755
--- a/dak/process_policy.py
+++ b/dak/process_policy.py
@@ -362,7 +362,11 @@ def remove_upload(upload, transaction):
queue_files = [upload.changes.changesname]
queue_files.extend(f.filename for f in chg.buildinfo_files)
for fn in queue_files:
- fs.unlink(os.path.join(queuedir, fn))
+ # We check for `path` to exist as old uploads in policy queues
+ # might still miss the `.buildinfo` files.
+ path = os.path.join(queuedir, fn)
+ if os.path.exists(path):
+ fs.unlink(path)
session.delete(upload)
session.flush()
--
2.1.4
Reply to: