Use new tenant project index for config references
When a job specifies an ansible role from zuul, use the new
tenant project index to find the referenced project. Do the
same when a job specifies an allowed-projects list.
Story: 2000953
Change-Id: I03876be039dab2e11bcd4afc048a2e54db363332
diff --git a/zuul/configloader.py b/zuul/configloader.py
index dcf831a..5009ca6 100644
--- a/zuul/configloader.py
+++ b/zuul/configloader.py
@@ -355,10 +355,7 @@
if allowed_projects:
allowed = []
for p in as_list(allowed_projects):
- # TODOv3(jeblair): this limits allowed_projects to the same
- # source; we should remove that limitation.
- source = job.source_context.project.connection_name
- (trusted, project) = tenant.getRepo(source, p)
+ (trusted, project) = tenant.getProject(p)
if project is None:
raise Exception("Unknown project %s" % (p,))
allowed.append(project.name)
@@ -394,14 +391,12 @@
def _makeZuulRole(tenant, job, role):
name = role['zuul'].split('/')[-1]
- # TODOv3(jeblair): this limits roles to the same
- # source; we should remove that limitation.
- source = job.source_context.project.connection_name
- (trusted, project) = tenant.getRepo(source, role['zuul'])
+ (trusted, project) = tenant.getProject(role['zuul'])
if project is None:
return None
- return model.ZuulRole(role.get('name', name), source,
+ return model.ZuulRole(role.get('name', name),
+ project.connection_name,
project.name, trusted)