Add --runs, to print only run names

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
This commit is contained in:
Zack Cerza 2014-04-29 11:26:39 -05:00
parent a9d7aa3514
commit 041666b07a
2 changed files with 6 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import teuthology.beanstalk
doc = """
usage: teuthology-queue -h
teuthology-queue [-d] -m MACHINE_TYPE
teuthology-queue [-r] -m MACHINE_TYPE
teuthology-queue -m MACHINE_TYPE -D PATTERN
List Jobs in queue:
@ -19,6 +20,7 @@ optional arguments:
-h, --help Show this help message and exit
-D, --delete PATTERN Delete Jobs with PATTERN in their name
-d, --description Show job descriptions
-r, --runs Only show run names
""".format(archive_base=teuthology.config.config.archive_base)

View File

@ -100,6 +100,7 @@ def print_matching_runs(jobs_dict):
def main(args):
machine_type = args['--machine_type']
delete = args['--delete']
runs = args['--runs']
show_desc = args['--description']
try:
connection = connect()
@ -107,6 +108,9 @@ def main(args):
if delete:
walk_jobs(connection, machine_type,
delete_matching_jobs)
elif runs:
walk_jobs(connection, machine_type,
print_matching_runs)
else:
walk_jobs(connection, machine_type,
_print_matching_jobs(show_desc))