From 4d668437c24c3740153c2b98b423fc6d8c4daf84 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 24 Jun 2014 17:09:33 -0700 Subject: [PATCH] Properly group check for branch in zuul functions Not every zuul changeish has a branch. As a result we must check that the object has a branch attribute before accessing it. The code previously attempted to do this but due to precedence rules the binding of the check was wrong and insufficient. Fix this with liberal use of ()s to make the precedence explicit and correct. Change-Id: I06b3fd7ec4e5bdd14af3bc0bb1f7da39e238a879 --- .../openstack_project/files/zuul/openstack_functions.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openstack_project/files/zuul/openstack_functions.py b/modules/openstack_project/files/zuul/openstack_functions.py index 89e5ac2244..211c9a11ce 100644 --- a/modules/openstack_project/files/zuul/openstack_functions.py +++ b/modules/openstack_project/files/zuul/openstack_functions.py @@ -43,8 +43,8 @@ def devstack_params(item, job, params): # This is necessary to get the gearman plugin to register # gearman jobs with both node labels. if ((hasattr(change, 'branch') and - change.branch == 'stable/havana' or - change.branch == 'stable/icehouse') or + (change.branch == 'stable/havana' or + change.branch == 'stable/icehouse')) or ('havana' in job.name or 'icehouse' in job.name or 'precise' in job.name)): @@ -67,8 +67,8 @@ def default_params_trusty(item, job, params): # This is necessary to get the gearman plugin to register # gearman jobs with both node labels. if ((hasattr(change, 'branch') and - change.branch == 'stable/havana' or - change.branch == 'stable/icehouse') or + (change.branch == 'stable/havana' or + change.branch == 'stable/icehouse')) or ('havana' in job.name or 'icehouse' in job.name or 'precise' in job.name)):