]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
schedule: add option to display jobs in the queue
authorJosh Durgin <josh.durgin@inktank.com>
Fri, 2 Nov 2012 18:08:25 +0000 (11:08 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Fri, 2 Nov 2012 18:08:59 +0000 (11:08 -0700)
beanstalkd doesn't let you list jobs in the queue, but you can
inpsect specific job ids.

teuthology/run.py

index 89edb3a7dadf383091ebc2551788a8d3fcf3a090..0bb540c76904f40f2295399d042437199bb1bf51 100644 (file)
@@ -233,6 +233,13 @@ def schedule():
         default='master',
         help='which branch of teuthology to use',
         )
+    parser.add_argument(
+        '-s', '--show',
+        metavar='JOBID',
+        type=int,
+        nargs='*',
+        help='output the contents of specified jobs in the queue',
+        )
 
     ctx = parser.parse_args()
     if not ctx.last_in_suite:
@@ -252,6 +259,15 @@ def schedule():
         tube += '-' + ctx.branch
     beanstalk.use(tube)
 
+    if ctx.list:
+        for jobid in ctx.list:
+            job = beanstalk.peek(jobid)
+            if job is None and ctx.verbose:
+                print 'job {jid} is not in the queue'.format(jid=jobid)
+            else:
+                print 'job {jid} contains: '.format(jid=jobid), job.body
+        return
+
     if ctx.delete:
         for jobid in ctx.delete:
             job = beanstalk.peek(jobid)