Fix missing check if logger is None

2019-05-15 10:14:22,482 ERROR zuul.Scheduler: Exception in run handler:
Traceback (most recent call last):
  File "/opt/zuul/lib/python3.7/site-packages/zuul/scheduler.py", line 1062, in run
    while (pipeline.manager.processQueue() and
  File "/opt/zuul/lib/python3.7/site-packages/zuul/manager/__init__.py", line 788, in processQueue
    item, nnfi)
  File "/opt/zuul/lib/python3.7/site-packages/zuul/manager/__init__.py", line 744, in _processOneItem
    if ready and self.executeJobs(item):
  File "/opt/zuul/lib/python3.7/site-packages/zuul/manager/__init__.py", line 417, in executeJobs
    item.pipeline.tenant.semaphore_handler)
  File "/opt/zuul/lib/python3.7/site-packages/zuul/model.py", line 2450, in findJobsToRun
    job.updateParentData(parent_build)
  File "/opt/zuul/lib/python3.7/site-packages/zuul/model.py", line 1433, in updateParentData
    artifacts = get_artifacts_from_result_data(other_vars)
  File "/opt/zuul/lib/python3.7/site-packages/zuul/lib/artifacts.py", line 70, in get_artifacts_from_result_data
    logger.debug("Result data did not pass artifact schema "
AttributeError: 'NoneType' object has no attribute 'debug'

Change-Id: I66d8541a242081be2d1a3d14c279108d34dc04fe
This commit is contained in:
Simon Westphahl 2019-05-15 12:22:36 +02:00
parent 4a0261c9a8
commit 41496033a2
1 changed files with 3 additions and 2 deletions

View File

@ -67,6 +67,7 @@ def get_artifacts_from_result_data(result_data, logger=None):
d['url'] = url
ret.append(d)
else:
logger.debug("Result data did not pass artifact schema "
"validation: %s", result_data)
if logger:
logger.debug("Result data did not pass artifact schema "
"validation: %s", result_data)
return ret