]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add --dry-run 503/head
authorZack Cerza <zack@redhat.com>
Wed, 27 May 2015 15:46:50 +0000 (09:46 -0600)
committerZack Cerza <zack@redhat.com>
Mon, 1 Jun 2015 18:49:06 +0000 (12:49 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
scripts/nuke.py
teuthology/nuke.py

index d9722b93573f40662ad778599bd0bf7692a20949..53fa51ede237f1f62a3302876123c9356341101f 100644 (file)
@@ -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
index af02a6085f54ddc7697a590df7717483e1db85de..bf76bc75eeeb57a2e04aa6b24da40eb90fc8354d 100644 (file)
@@ -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()