diff options
author | Clark Boylan <clark.boylan@gmail.com> | 2021-11-11 14:30:54 -0800 |
---|---|---|
committer | Clark Boylan <clark.boylan@gmail.com> | 2021-11-15 15:16:25 -0800 |
commit | 5b1ba567c8f0858044a5b977850ec89e7a7cb0de (patch) | |
tree | 4d542eba01920a30beeb1c9266006c2c10418354 /zuul/cmd | |
parent | 567a664ab9a3238ead120c6cfab1c757dd13f17d (diff) | |
download | zuul-5b1ba567c8f0858044a5b977850ec89e7a7cb0de.tar.gz |
Prevent duplicate config file entries
It is currently possible to list default zuul config file paths in the
extra-config-paths config directive. Doing so will duplicate the configs
in Zuul which can cause problems. Prevent this entirely via
configuration validation.
Note: There has been a bit of refactoring to ensure that the voluptuous
schema is validated when reading the config. This ensures that an
invalid config doesn't produce hard to understand error messages because
loadTPCs() has attempted to process configuration that isn't valid.
Instead we can catch schema errors early and report them with human
friendly messages.
Change-Id: I07e9d4d3614cbc6cdee06b2866f7ae41d7779135
Diffstat (limited to 'zuul/cmd')
-rwxr-xr-x | zuul/cmd/client.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/zuul/cmd/client.py b/zuul/cmd/client.py index c9a7ba758..95873334e 100755 --- a/zuul/cmd/client.py +++ b/zuul/cmd/client.py @@ -838,8 +838,9 @@ class Client(zuul.cmd.ZuulApp): self.connections, zk_client, zuul_globals) sched = SchedulerConfig(self.config, self.connections) tenant_config, script = sched._checkTenantSourceConf(self.config) - unparsed_abide = loader.readConfig(tenant_config, from_script=script) try: + unparsed_abide = loader.readConfig( + tenant_config, from_script=script) for conf_tenant in unparsed_abide.tenants.values(): loader.tenant_parser.getSchema()(conf_tenant) print("Tenants config validated with success") |