]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Allow killing jobs by passing a 'jobspec'.
authorZack Cerza <zack@cerza.org>
Fri, 20 Jun 2014 15:36:55 +0000 (11:36 -0400)
committerZack Cerza <zack@cerza.org>
Fri, 20 Jun 2014 15:39:47 +0000 (11:39 -0400)
See teuthology-kill --help

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
scripts/kill.py
teuthology/kill.py

index cef3e0ca84a2bbff62dbacdf26f052e03d66f228..f46bb7c52c18fcfcb5ce85788244366e687ec2c4 100644 (file)
@@ -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.
index c8f746e3eaebceae0c190d3b138f6da82ac90917..6ea9359b4326d423f00714553471e17fc53922a0 100755 (executable)
@@ -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)