]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ls: include duration, less noise
authorSage Weil <sage@newdream.net>
Mon, 16 Jan 2012 21:18:49 +0000 (13:18 -0800)
committerSage Weil <sage@newdream.net>
Mon, 16 Jan 2012 21:18:49 +0000 (13:18 -0800)
teuthology/suite.py

index 34b8a81b5abb7a390a5578a7e01c6d2020e6df45..f53e83a234b90bfd85ab3093e35ec22fa49538fe 100644 (file)
@@ -168,22 +168,26 @@ def ls():
                     summary.update(new)
         except IOError, e:
             if e.errno == errno.ENOENT:
-                print "%s      (no summary.yaml)" % j,
+                print '%s      ',
 
                 # pid
                 try:
                     pidfile = '%s/%s/pid' % (args.archive_dir, j)
+                    found = False
                     if os.path.isfile(pidfile):
                         pid = open(pidfile, 'r').read()
                         if os.path.isdir("/proc/%s" % pid):
                             cmdline = open('/proc/%s/cmdline' % pid, 'r').read()
                             if cmdline.find(args.archive_dir) >= 0:
-                                print ' (pid %s)' % pid,
+                                print '(pid %s)' % pid,
+                                found = True
+                    if not found:
+                        '(no process or summary.yaml)' % j,
                     # tail
                     tail = os.popen(
                         'tail -1 %s/%s/teuthology.log' % (args.archive_dir, j)
                         ).read().rstrip()
-                    print " (tail '%s')" % tail,
+                    print tail,
                 except IOError, e:
                     continue
                 print ''
@@ -191,11 +195,12 @@ def ls():
             else:
                 raise
 
-        print "{job} {success} {owner} {desc}".format(
+        print "{job} {success} {owner} {desc} {duration}s".format(
             job=j,
             owner=summary.get('owner', '-'),
             desc=summary.get('description', '-'),
             success='pass' if summary['success'] else 'FAIL',
+            duration=int(summary.get('duration', 0))
             )
         if args.verbose and 'failure_reason' in summary:
             print '    {reason}'.format(reason=summary['failure_reason'])