From: Zack Cerza Date: Wed, 27 May 2015 15:46:50 +0000 (-0600) Subject: Add --dry-run X-Git-Tag: 1.1.0~927^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F503%2Fhead;p=teuthology.git Add --dry-run Signed-off-by: Zack Cerza --- diff --git a/scripts/nuke.py b/scripts/nuke.py index d9722b93..53fa51ed 100644 --- a/scripts/nuke.py +++ b/scripts/nuke.py @@ -3,10 +3,11 @@ import docopt import teuthology.nuke doc = """ -usage: teuthology-nuke --help - teuthology-nuke [-v] [--owner OWNER] [-n NAME] [-u] [-i] [-r] [-s] - [-p PID] (-t CONFIG... | -a DIR) - teuthology-nuke [-v] [-u] [-i] [-r] [-s] --owner OWNER --stale +usage: + teuthology-nuke --help + teuthology-nuke [-v] [--owner OWNER] [-n NAME] [-u] [-i] [-r] [-s] + [-p PID] [--dry-run] (-t CONFIG... | -a DIR) + teuthology-nuke [-v] [-u] [-i] [-r] [-s] [--dry-run] --owner OWNER --stale Reset test machines @@ -19,6 +20,8 @@ optional arguments: archive path for a job to kill and nuke --stale attempt to find and nuke 'stale' machines (e.g. locked by jobs that are no longer running) + --dry-run Don't actually nuke anything; just print the list of + targets that would be nuked --owner OWNER job owner -p PID, --pid PID pid of the process to be killed -r, --reboot-all reboot all machines diff --git a/teuthology/nuke.py b/teuthology/nuke.py index af02a608..bf76bc75 100644 --- a/teuthology/nuke.py +++ b/teuthology/nuke.py @@ -384,6 +384,10 @@ def main(args): ctx.config['targets'], default_flow_style=False).splitlines())) + if ctx.dry_run: + log.info("Not actually nuking anything since --dry-run was passed") + return + if ctx.owner is None: ctx.owner = get_user()