'--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,
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()
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'):