]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Remote 'delete' and 'show' features
authorZack Cerza <zack@cerza.org>
Mon, 9 Jun 2014 17:42:34 +0000 (12:42 -0500)
committerZack Cerza <zack@cerza.org>
Mon, 9 Jun 2014 23:31:01 +0000 (18:31 -0500)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
scripts/schedule.py
teuthology/schedule.py

index 62732f2d10ba4c70364eb56f8b1922fdc17297f2..6a43e5e6d82586b1036853631b1ac4b26c4dfcc9 100644 (file)
@@ -50,13 +50,6 @@ def parse_args():
         '--owner',
         help='job owner',
     )
-    parser.add_argument(
-        '--delete',
-        metavar='JOBID',
-        type=int,
-        nargs='*',
-        help='list of jobs to remove from the queue',
-    )
     parser.add_argument(
         '-n', '--num',
         default=1,
@@ -80,13 +73,6 @@ def parse_args():
         default='plana',
         help='which worker to use (type of machine)',
     )
-    parser.add_argument(
-        '-s', '--show',
-        metavar='JOBID',
-        type=int,
-        nargs='*',
-        help='output the contents of specified jobs in the queue',
-    )
 
     args = parser.parse_args()
 
index a147e3d16458b85a63ec813bf29f86ac042c181f..6efe0518d4c30ee3bc70a6f99da637c5024c19a9 100644 (file)
@@ -16,29 +16,6 @@ def main(ctx):
     tube = ctx.worker
     beanstalk.use(tube)
 
-    if ctx.show:
-        for job_id in ctx.show:
-            job = beanstalk.peek(job_id)
-            if job is None and ctx.verbose:
-                print 'job {jid} is not in the queue'.format(jid=job_id)
-            else:
-                print '--- job {jid} priority {prio} ---\n'.format(
-                    jid=job_id,
-                    prio=job.stats()['pri']), job.body
-        return
-
-    if ctx.delete:
-        for job_id in ctx.delete:
-            job = beanstalk.peek(job_id)
-            if job is None:
-                print 'job {jid} is not in the queue'.format(jid=job_id)
-            else:
-                job.delete()
-                name = yaml.safe_load(job.body).get('name')
-                if name:
-                    report.try_delete_jobs(name, job_id)
-        return
-
     # strip out targets; the worker will allocate new ones when we run
     # the job with --lock.
     if ctx.config.get('targets'):