]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
ls: nicer ls output 1612/head
authorSage Weil <sage@redhat.com>
Wed, 10 Feb 2021 22:22:53 +0000 (22:22 +0000)
committerSage Weil <sage@redhat.com>
Thu, 11 Feb 2021 14:46:45 +0000 (14:46 +0000)
- no error when teuthology.log is missing (provisioning)
- leave off pid

Signed-off-by: Sage Weil <sage@redhat.com>
teuthology/ls.py

index fe85659d10b37cb9bc133a92fa59e3bfb08f56fe..a50a59d176a92f61848071cabfd4fd6dae5bcae4 100644 (file)
@@ -56,23 +56,14 @@ def print_debug_info(job, job_dir, archive_dir):
     print('%s      ' % job, end='')
 
     try:
-        pidfile = os.path.join(job_dir, 'pid')
-        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(archive_dir) >= 0:
-                    print('(pid %s)' % pid, end='')
-                    found = True
-        if not found:
-            print('(no process or summary.yaml)', end='')
-        # tail
-        tail = os.popen(
-            'tail -1 %s/%s/teuthology.log' % (archive_dir, job)
-        ).read().rstrip()
-        print(tail, end='')
+        log_path = os.path.join(archive_dir, job, 'teuthology.log')
+        if os.path.exists(log_path):
+            tail = os.popen(
+                'tail -1 %s' % log_path
+            ).read().rstrip()
+            print(tail, end='')
+        else:
+            print('<no teuthology.log yet>', end='')
     except IOError:
         pass
     print('')