From 6dbf53e298d918313093586d633925a621f7452e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 3 Jul 2012 12:53:08 -0700 Subject: [PATCH] nuke: nuke based on archive path Use path/config.yaml for targets, path/pid for pid to kill, and path/owner for job owner. --- teuthology/nuke.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/teuthology/nuke.py b/teuthology/nuke.py index 8aa5b8b744..09a84f9111 100644 --- a/teuthology/nuke.py +++ b/teuthology/nuke.py @@ -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) -- 2.39.5