From 5eba2458c79d1c82b7d76b19c3e1e8d8a5de32de Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Fri, 29 Apr 2016 13:21:18 -0600 Subject: [PATCH] Prune mon data along with remote logs Signed-off-by: Zack Cerza --- teuthology/prune.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/teuthology/prune.py b/teuthology/prune.py index 95937e1f6..b345ab0fc 100644 --- a/teuthology/prune.py +++ b/teuthology/prune.py @@ -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): -- 2.47.3