]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add a flag to dump the entire job body.
authorZack Cerza <zack@cerza.org>
Fri, 11 Jul 2014 20:55:09 +0000 (14:55 -0600)
committerZack Cerza <zack@cerza.org>
Fri, 11 Jul 2014 20:55:09 +0000 (14:55 -0600)
... with a warning.

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
scripts/queue.py
teuthology/beanstalk.py

index 15bbafdc1ffd2ff0c206416662effd66dc4b1c50..2436013d031ad34302c4a003571e54a2b8fb68c6 100644 (file)
@@ -5,7 +5,7 @@ import teuthology.beanstalk
 
 doc = """
 usage: teuthology-queue -h
-       teuthology-queue [-d] -m MACHINE_TYPE
+       teuthology-queue [-d|-f] -m MACHINE_TYPE
        teuthology-queue [-r] -m MACHINE_TYPE
        teuthology-queue -m MACHINE_TYPE -D PATTERN
 
@@ -22,6 +22,7 @@ optional arguments:
   -D, --delete PATTERN  Delete Jobs with PATTERN in their name
   -d, --description     Show job descriptions
   -r, --runs            Only show run names
+  -f, --full            Print the entire job config. Use with caution.
 """.format(archive_base=teuthology.config.config.archive_base)
 
 
index 7bf9698ad2fe595fff83e2517dfa190b7803cdae..f2d20fc14b18662c85fe12917153c1da7702126a 100644 (file)
@@ -1,6 +1,7 @@
 import beanstalkc
 import yaml
 import logging
+import pprint
 import sys
 from collections import OrderedDict
 
@@ -97,9 +98,10 @@ class JobProcessor(object):
 
 
 class JobPrinter(JobProcessor):
-    def __init__(self, show_desc=False):
+    def __init__(self, show_desc=False, full=False):
         super(JobPrinter, self).__init__()
         self.show_desc = show_desc
+        self.full = full
 
     def process_job(self, job_id):
         job_config = self.jobs[job_id]['job_config']
@@ -111,7 +113,9 @@ class JobPrinter(JobProcessor):
             job_id=job_id,
             job_name=job_name,
             )
-        if job_desc and self.show_desc:
+        if self.full:
+            pprint.pprint(job_config)
+        elif job_desc and self.show_desc:
             for desc in job_desc.split():
                 print '\t {desc}'.format(desc=desc)
 
@@ -156,6 +160,7 @@ def main(args):
     delete = args['--delete']
     runs = args['--runs']
     show_desc = args['--description']
+    full = args['--full']
     try:
         connection = connect()
         watch_tube(connection, machine_type)
@@ -167,7 +172,7 @@ def main(args):
                       RunPrinter())
         else:
             walk_jobs(connection, machine_type,
-                      JobPrinter(show_desc=show_desc))
+                      JobPrinter(show_desc=show_desc, full=full))
     except KeyboardInterrupt:
         log.info("Interrupted.")
     finally: