summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-04-08 18:21:24 +0000
committerGerrit Code Review <review@openstack.org>2016-04-08 18:21:24 +0000
commit224ed54b1e614f0bbcceb695eb72d4029dbf1654 (patch)
treec50df4f1cfaa4c1d71902862468c7c1343d74db0
parentaff061f15c45e5ccd99c2ef7f463dc7250968898 (diff)
parent3663cc2be0a8469b197c9571607294e46d3d8db3 (diff)
Merge "Fix log_url parsing for new job types"
-rw-r--r--files/subunit-gearman-worker.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/files/subunit-gearman-worker.py b/files/subunit-gearman-worker.py
index b16fb92..36a11b2 100644
--- a/files/subunit-gearman-worker.py
+++ b/files/subunit-gearman-worker.py
@@ -180,7 +180,17 @@ class Subunit2SQLProcessor(object):
180 # Set run metadata from gearman 180 # Set run metadata from gearman
181 log_url = subunit.pop('log_url', None) 181 log_url = subunit.pop('log_url', None)
182 if log_url: 182 if log_url:
183 log_dir = os.path.dirname(os.path.dirname(log_url)) 183 log_dir = os.path.dirname(log_url)
184
185 # log_dir should be the top-level directory containing a job run,
186 # but the subunit file may be nested in 0 - 2 subdirectories (top,
187 # logs/, or logs/old/), so we need to safely correct the path here
188 log_base = os.path.basename(log_dir)
189 if log_base == 'logs':
190 log_dir = os.path.dirname(log_dir)
191 elif log_base == 'old':
192 log_dir = os.path.dirname(os.path.dirname(log_dir))
193
184 shell.CONF.set_override('artifacts', log_dir) 194 shell.CONF.set_override('artifacts', log_dir)
185 shell.CONF.set_override('run_meta', subunit) 195 shell.CONF.set_override('run_meta', subunit)
186 # Parse subunit stream and store in DB 196 # Parse subunit stream and store in DB