teuthology-queue [-d|-f] -m MACHINE_TYPE
teuthology-queue [-r] -m MACHINE_TYPE
teuthology-queue -m MACHINE_TYPE -D PATTERN
+ teuthology-queue -p SECONDS [-m MACHINE_TYPE]
List Jobs in queue.
If -D is passed, then jobs with PATTERN in the job name are deleted from the
-d, --description Show job descriptions
-r, --runs Only show run names
-f, --full Print the entire job config. Use with caution.
+ -p, --pause SECONDS Pause queues for a number of seconds. A value of 0
+ will unpause. If -m is passed, pause that queue,
+ otherwise pause all queues.
""".format(archive_base=teuthology.config.config.archive_base)
report.try_delete_jobs(job_name, job_id)
+def pause_tube(connection, tube, duration):
+ duration = int(duration)
+ if not tube:
+ tubes = sorted(connection.tubes())
+ else:
+ tubes = [tube]
+
+ prefix = 'Unpausing' if duration == 0 else "Pausing for {dur}s"
+ templ = prefix + ": {tubes}"
+ log.info(templ.format(dur=duration, tubes=tubes))
+ for tube in tubes:
+ connection.pause_tube(tube, duration)
+
+
def main(args):
machine_type = args['--machine_type']
delete = args['--delete']
runs = args['--runs']
show_desc = args['--description']
full = args['--full']
+ pause_duration = args['--pause']
try:
connection = connect()
- watch_tube(connection, machine_type)
- if delete:
+ if machine_type and not pause_duration:
+ # watch_tube needs to be run before we inspect individual jobs;
+ # it is not needed for pausing tubes
+ watch_tube(connection, machine_type)
+ if pause_duration:
+ pause_tube(connection, machine_type, pause_duration)
+ elif delete:
walk_jobs(connection, machine_type,
JobDeleter(delete))
elif runs: