model: fix AttributeError exception in freezeJobGraph

This is a follow-up to https://review.openstack.org/577881 which added
debug statements that do not work if the project doesn't have a PipelineConfig
when it is configured using include: [].

The exception fixed is:

ERROR zuul.Pipeline.check: Error freezing job graph
Traceback (most recent call last):
  File "zuul/manager/__init__.py", line 569, in prepareJobs
    item.freezeJobGraph()
  File "zuul/model.py", line 1805, in freezeJobGraph
    for msg in ppc.debug_messages:
AttributeError: 'NoneType' object has no attribute 'debug_messages'

Change-Id: I93470c66b59c0c36c455cfa1c21af46ff21608ab
This commit is contained in:
Tristan Cacqueray 2018-07-02 04:19:32 +00:00
parent 02682856a0
commit c2fe7713fe
1 changed files with 3 additions and 2 deletions

View File

@ -1753,8 +1753,9 @@ class QueueItem(object):
# Conditionally set self.ppc so that the debug method can
# consult it as we resolve the jobs.
self.project_pipeline_config = ppc
for msg in ppc.debug_messages:
self.debug(msg)
if ppc:
for msg in ppc.debug_messages:
self.debug(msg)
job_graph = self.layout.createJobGraph(self, ppc)
for job in job_graph.getJobs():
# Ensure that each jobs's dependencies are fully