]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
prune: use the shortest time of -p or -r to decide on processing 1026/head
authorDan Mick <dan.mick@redhat.com>
Tue, 7 Feb 2017 20:07:47 +0000 (12:07 -0800)
committerDan Mick <dan.mick@redhat.com>
Tue, 7 Feb 2017 20:07:47 +0000 (12:07 -0800)
invoking -p 7 -r 30 was only removing passed jobs 30 days or older.

Signed-off-by: Dan Mick <dan.mick@redhat.com>
teuthology/prune.py

index 8b90018778b0a4e6c9e69a553d63c3c1bb7e715a..05bfb7874c1ff1e7b0decb3288cb4335c6609826 100644 (file)
@@ -43,7 +43,7 @@ def prune_archive(
     Walk through the archive_dir, calling the cleanup functions to process
     directories that might be old enough
     """
-    max_days = max(pass_days, remotes_days)
+    max_days = min(pass_days, remotes_days)
     log.debug("Archive {archive} has {count} children".format(
         archive=archive_dir, count=len(os.listdir(archive_dir))))
     # Use full paths