]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
nuke: nuke based on archive path
authorSage Weil <sage@newdream.net>
Tue, 3 Jul 2012 19:53:08 +0000 (12:53 -0700)
committerSage Weil <sage@newdream.net>
Wed, 4 Jul 2012 21:47:33 +0000 (14:47 -0700)
Use path/config.yaml for targets, path/pid for pid to kill, and
path/owner for job owner.

teuthology/nuke.py

index 8aa5b8b7443cb8885f920614c1dc3c1bfb581ba0..09a84f911131c2edda8da4f1a69408278ac24e24 100644 (file)
@@ -17,14 +17,13 @@ def parse_args():
         type=config_file,
         action=MergeConfig,
         default={},
-        required=True,
         dest='config',
         help='yaml config containing machines to nuke',
         )
     parser.add_argument(
-        '--archive',
+        '-a', '--archive',
         metavar='DIR',
-        help='path to archive results in',
+        help='archive path for a job to kill and nuke',
         )
     parser.add_argument(
         '--owner',
@@ -244,6 +243,7 @@ def synch_clocks(remotes, log):
 def main():
     from gevent import monkey; monkey.patch_all()
     from .orchestra import monkey; monkey.patch_all()
+    from teuthology.run import config_file
 
     import logging
 
@@ -259,6 +259,13 @@ def main():
         level=loglevel,
         )
 
+    if ctx.archive:
+        ctx.config = config_file(ctx.archive + '/config.yaml')
+        if not ctx.pid:
+            ctx.pid = int open(ctx.archive + '/pid').read().rstrip('\n')
+        if not ctx.owner:
+            ctx.owner = open(ctx.archive + '/owner').read().rstrip('\n')
+
     from teuthology.misc import read_config
     read_config(ctx)