From: Zack Cerza Date: Fri, 20 Jun 2014 15:36:55 +0000 (-0400) Subject: Allow killing jobs by passing a 'jobspec'. X-Git-Tag: 1.1.0~1401 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5cd50a42bef01f19ac25b888cc694c4fb42f50d6;p=teuthology.git Allow killing jobs by passing a 'jobspec'. See teuthology-kill --help Signed-off-by: Zack Cerza --- diff --git a/scripts/kill.py b/scripts/kill.py index cef3e0ca8..f46bb7c52 100644 --- a/scripts/kill.py +++ b/scripts/kill.py @@ -8,6 +8,7 @@ usage: teuthology-kill -h teuthology-kill [-a ARCHIVE] [-p] -r RUN teuthology-kill [-a ARCHIVE] [-p] -m MACHINE_TYPE -r RUN teuthology-kill [-a ARCHIVE] -r RUN -j JOB ... + teuthology-kill [-a ARCHIVE] -J JOBSPEC teuthology-kill [-p] -o OWNER -m MACHINE_TYPE -r RUN Kill running teuthology jobs: @@ -23,6 +24,10 @@ optional arguments: -p, --preserve-queue Preserve the queue - do not delete queued jobs -r, --run RUN The name(s) of the run(s) to kill -j, --job JOB The job_id of the job to kill + -J, --jobspec JOBSPEC + The 'jobspec' of the job to kill. A jobspec consists of + both the name of the run and the job_id, separated by a + '/'. e.g. 'my-test-run/1234' -o, --owner OWNER The owner of the job(s) -m, --machine_type MACHINE_TYPE The type of machine the job(s) are running on. diff --git a/teuthology/kill.py b/teuthology/kill.py index c8f746e3e..6ea9359b4 100755 --- a/teuthology/kill.py +++ b/teuthology/kill.py @@ -18,11 +18,17 @@ log = logging.getLogger(__name__) def main(args): run_name = args['--run'] job = args['--job'] + jobspec = args['--jobspec'] archive_base = args['--archive'] owner = args['--owner'] machine_type = args['--machine_type'] preserve_queue = args['--preserve-queue'] + if jobspec: + split_spec = jobspec.split('/') + run_name = split_spec[0] + job = [split_spec[1]] + if job: for job_id in job: kill_job(run_name, job_id, archive_base, owner, machine_type)