From 812868194498a4f78baa79eaa33232bbeb1cb38a Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 24 Jun 2014 11:46:16 -0700 Subject: [PATCH] Choose precise, centos6, and trusty nodes properly The zuul node label selection functions missed a few corner cases where precise, centos6, or trusty needed to be selected. Specifically if the job name includes precise that job should run on precise. If the job name says centos6 that job should run on centos6 and so on. Change-Id: If9a99c0347412c8bb54dd663dbdca4908cb3eb03 --- .../files/zuul/openstack_functions.py | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/modules/openstack_project/files/zuul/openstack_functions.py b/modules/openstack_project/files/zuul/openstack_functions.py index 8be03152de..89e5ac2244 100644 --- a/modules/openstack_project/files/zuul/openstack_functions.py +++ b/modules/openstack_project/files/zuul/openstack_functions.py @@ -46,14 +46,18 @@ def devstack_params(item, job, params): change.branch == 'stable/havana' or change.branch == 'stable/icehouse') or ('havana' in job.name or - 'icehouse' in job.name)): + 'icehouse' in job.name or + 'precise' in job.name)): params['ZUUL_NODE'] = 'devstack-precise' else: params['ZUUL_NODE'] = 'devstack-trusty' def default_params_precise(item, job, params): - params['ZUUL_NODE'] = 'bare-precise' + if 'trusty' in job.name: + params['ZUUL_NODE'] = 'bare-trusty' + else: + params['ZUUL_NODE'] = 'bare-precise' def default_params_trusty(item, job, params): @@ -62,9 +66,12 @@ def default_params_trusty(item, job, params): # jenkins uses 'bare-precise || bare-trusty'. # This is necessary to get the gearman plugin to register # gearman jobs with both node labels. - if (hasattr(change, 'branch') and + if ((hasattr(change, 'branch') and change.branch == 'stable/havana' or - change.branch == 'stable/icehouse'): + change.branch == 'stable/icehouse') or + ('havana' in job.name or + 'icehouse' in job.name or + 'precise' in job.name)): params['ZUUL_NODE'] = 'bare-precise' else: params['ZUUL_NODE'] = 'bare-trusty' @@ -80,6 +87,7 @@ def set_node_options(item, job, params, default): pypi_re = r'^.*-(jenkinsci|mavencentral|pypi-(both|wheel))-upload$' mirror_re = r'^(periodic|post)-mirror-python(26|27|33)$' python26_re = r'^.*-py(thon)?26.*$' + centos6_re = r'^.*-centos6.*$' python33_re = r'^.*-py(py|(thon)?33).*$' tripleo_re = r'^.*-tripleo.*$' devstack_re = r'^.*-dsvm.*$' @@ -93,6 +101,10 @@ def set_node_options(item, job, params, default): elif re.match(python26_re, job.name): # Pass because job specified label is always correct. pass + # Jobs needing centos6 + elif re.match(centos6_re, job.name): + # Pass because job specified label is always correct. + pass # Jobs needing py33/pypy slaves elif re.match(python33_re, job.name): # Pass because job specified label is always correct.