]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Prune mon data along with remote logs 851/head
authorZack Cerza <zack@redhat.com>
Fri, 29 Apr 2016 19:21:18 +0000 (13:21 -0600)
committerZack Cerza <zack@redhat.com>
Fri, 29 Apr 2016 19:27:02 +0000 (13:27 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/prune.py

index 95937e1f6830d1b3c87b877f2d9a4e688dc1c4e4..b345ab0fc74902f6c8fdf2efc31b8726dab8107e 100644 (file)
@@ -139,6 +139,10 @@ def maybe_remove_remotes(run_dir, days, dry_run=False):
     if days < 0:
         return
     contents = listdir(run_dir)
+    subdirs = dict(
+        remote='remote logs',
+        data='mon data',
+    )
     if PRESERVE_FILE in contents:
         return
     for child in contents:
@@ -148,7 +152,8 @@ def maybe_remove_remotes(run_dir, days, dry_run=False):
         if (should_preserve(item) or not os.path.isdir(item) or not
                 is_old_enough(item, days)):
             continue
-        _maybe_remove_subdir(item, 'remote', days, 'remote logs', dry_run)
+        for (subdir, description) in subdirs.iteritems():
+            _maybe_remove_subdir(item, subdir, days, description, dry_run)
 
 
 def _maybe_remove_subdir(job_dir, subdir, days, description, dry_run=False):