From c2fe7713feac11cecaa56c3327a3dff13a78058e Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Mon, 2 Jul 2018 04:19:32 +0000 Subject: [PATCH] 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 --- zuul/model.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zuul/model.py b/zuul/model.py index de6d08aa43..2b02dea848 100644 --- a/zuul/model.py +++ b/zuul/model.py @@ -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