]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Be more informative if owner info is missing
authorZack Cerza <zack.cerza@inktank.com>
Mon, 11 Aug 2014 20:55:49 +0000 (14:55 -0600)
committerZack Cerza <zack.cerza@inktank.com>
Mon, 11 Aug 2014 20:55:49 +0000 (14:55 -0600)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
scripts/kill.py
teuthology/kill.py

index f46bb7c52c18fcfcb5ce85788244366e687ec2c4..f6fa92da43e0d4693af83172f0571fe496208fc7 100644 (file)
@@ -7,8 +7,8 @@ doc = """
 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 [-a ARCHIVE] [-o OWNER] -r RUN -j JOB ...
+       teuthology-kill [-a ARCHIVE] [-o OWNER] -J JOBSPEC
        teuthology-kill [-p] -o OWNER -m MACHINE_TYPE -r RUN
 
 Kill running teuthology jobs:
index bbdfc5bc4e7b2f8c36da9909e9ed9c737122a959..c49a3a1e4fa6b9833fbd53e22f9aaa491f5b7247 100755 (executable)
@@ -64,6 +64,10 @@ def kill_job(run_name, job_id, archive_base=None, owner=None,
              machine_type=None):
     serializer = report.ResultsSerializer(archive_base)
     job_info = serializer.job_info(run_name, job_id)
+    if not owner and 'owner' not in job_info:
+        raise RuntimeError(
+            "I could not figure out the owner of the requested job. "
+            "Please pass --owner <owner>.")
     owner = job_info['owner']
     kill_processes(run_name, [job_info.get('pid')])
     targets = dict(targets=job_info.get('targets', {}))