summaryrefslogtreecommitdiff
path: root/zuul
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2017-12-06 18:54:07 +0000
committerGerrit Code Review <review@openstack.org>2017-12-06 18:54:07 +0000
commit9bab764dacb9457493faf437aabe6d09dd02f679 (patch)
treea063ae2874e5dd405aeed4a8fd5313be1db9b749 /zuul
parent9a43af3f3aca8adc0ba031cfb0727807deacc5e9 (diff)
parent42234421c87a09d61d99dc57be8fa985d14b439b (diff)
downloadzuul-9bab764dacb9457493faf437aabe6d09dd02f679.tar.gz
Merge "Convert zuul.projects to a dict" into feature/zuulv3
Diffstat (limited to 'zuul')
-rw-r--r--zuul/executor/client.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/zuul/executor/client.py b/zuul/executor/client.py
index a8b94f023..06c2087f7 100644
--- a/zuul/executor/client.py
+++ b/zuul/executor/client.py
@@ -180,8 +180,7 @@ class ExecutorClient(object):
if (hasattr(item.change, 'newrev') and item.change.newrev
and item.change.newrev != '0' * 40):
zuul_params['newrev'] = item.change.newrev
- zuul_params['projects'] = [] # Set below
- zuul_params['_projects'] = {} # transitional to convert to dict
+ zuul_params['projects'] = {} # Set below
zuul_params['items'] = dependent_changes
params = dict()
@@ -253,7 +252,7 @@ class ExecutorClient(object):
params['projects'].append(make_project_dict(project))
projects.add(project)
for p in projects:
- zuul_params['_projects'][p.canonical_name] = (dict(
+ zuul_params['projects'][p.canonical_name] = (dict(
name=p.name,
short_name=p.name.split('/')[-1],
# Duplicate this into the dict too, so that iterating
@@ -265,12 +264,10 @@ class ExecutorClient(object):
))
# We are transitioning "projects" from a list to a dict
# indexed by canonical name, as it is much easier to access
- # values in ansible. Existing callers are converted to
- # "_projects", then once "projects" is unused we switch it,
- # then convert callers back. Finally when "_projects" is
- # unused it will be removed.
- for cn, p in zuul_params['_projects'].items():
- zuul_params['projects'].append(p)
+ # values in ansible. Existing callers have been converted to
+ # "_projects" and "projects" is swapped; we will convert users
+ # back to "projects" and remove this soon.
+ zuul_params['_projects'] = zuul_params['projects']
build = Build(job, uuid)
build.parameters = params