]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Tweak logic for pid lookup
authorZack Cerza <zack@cerza.org>
Tue, 10 Dec 2013 22:35:05 +0000 (16:35 -0600)
committerZack Cerza <zack@cerza.org>
Tue, 10 Dec 2013 22:48:07 +0000 (16:48 -0600)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/kill.py

index 9bff4371f72751542af84319dd3ccab44d2c3864..973d9d649c1e23c75d9c2377cdb2e3ba435e368d 100755 (executable)
@@ -41,7 +41,7 @@ def find_suite_info(suite_archive_dir):
         'owner',
     ]
 
-    suite_info = {}
+    suite_info = dict(pids=[])
     job_info = {}
     for job_id in os.listdir(suite_archive_dir):
         job_dir = os.path.join(suite_archive_dir, job_id)
@@ -52,9 +52,7 @@ def find_suite_info(suite_archive_dir):
             if key in suite_info_fields and key not in suite_info:
                 suite_info[key] = job_info[key]
         if 'pid' in job_info:
-            pids = suite_info.get('pids', [])
-            pids.append(job_info['pid'])
-            suite_info['pids'] = pids
+            suite_info['pids'].append(job_info['pid'])
     return suite_info