diff options
author | Tobias Henkel <tobias.henkel@bmw.de> | 2017-12-22 09:59:45 +0100 |
---|---|---|
committer | Tobias Henkel <tobias.henkel@bmw.de> | 2017-12-22 13:11:52 +0100 |
commit | 53aa2adffb72b6c4388afa218f42688be4f25c40 (patch) | |
tree | 44f718f614f03e1cbc63ce13b7d678fde47f54f3 /zuul/model.py | |
parent | 3dec9c962ae5709902ab3c3930a3799ec9ac7a43 (diff) | |
download | zuul-53aa2adffb72b6c4388afa218f42688be4f25c40.tar.gz |
Really fix canonical/non-canonical project merge
In change Icaf8fca3aa4577b009d691f9a67adcb43ea040f5 the merge of
canonical and non-canonical projects was fixed. However the fix was
not complete and only covered the static configuration workflow. The
dynamic configuration workflow is still broken.
Now really fix by canonicalize the project names in every case and
make the tenant parameter mandatory.
Change-Id: I5af74763fc9c4be395a341f28c6751d22bd46195
Diffstat (limited to 'zuul/model.py')
-rw-r--r-- | zuul/model.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/zuul/model.py b/zuul/model.py index dbae1f296..bf69fc4cc 100644 --- a/zuul/model.py +++ b/zuul/model.py @@ -2401,7 +2401,7 @@ class UnparsedTenantConfig(object): r.semaphores = copy.deepcopy(self.semaphores) return r - def extend(self, conf, tenant=None): + def extend(self, conf, tenant): if isinstance(conf, UnparsedTenantConfig): self.pragmas.extend(conf.pragmas) self.pipelines.extend(conf.pipelines) @@ -2409,16 +2409,14 @@ class UnparsedTenantConfig(object): self.project_templates.extend(conf.project_templates) for k, v in conf.projects.items(): name = k - # If we have the tenant add the projects to - # the according canonical name instead of the given project - # name. If it is not found, it's ok to add this to the given - # name. We also don't need to throw the + # Add the projects to the according canonical name instead of + # the given project name. If it is not found, it's ok to add + # this to the given name. We also don't need to throw the # ProjectNotFoundException here as semantic validation occurs # later where it will fail then. - if tenant is not None: - trusted, project = tenant.getProject(k) - if project is not None: - name = project.canonical_name + trusted, project = tenant.getProject(k) + if project is not None: + name = project.canonical_name self.projects.setdefault(name, []).extend(v) self.nodesets.extend(conf.nodesets) self.secrets.extend(conf.secrets) |