Commit a53b3f69 authored by Peter Hutterer's avatar Peter Hutterer
Browse files

Assert if a global key is used in a distribution file



Don't quietly skip if a distribution file uses a key in our globals file,
abort if that is the case. There's no good reason to overwrite these.

And de-indent this block while we're here, the file loading is complete if
we make it past the yaml loading.
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent a8578f6d
......@@ -24,15 +24,15 @@ if __name__ == '__main__':
with open(distrib) as fd:
data = yaml.load(fd, Loader=yaml.Loader)
# for each root element in each yaml file
for config in data.values():
# add missing keys from the globals
for key, value in globs.items():
if key not in config:
config[key] = value
# store the generated values in the base config dictionary
config_data.update(data)
# for each root element in each yaml file
for config in data.values():
# add missing keys from the globals
for key, value in globs.items():
assert key not in config
config[key] = value
# store the generated values in the base config dictionary
config_data.update(data)
out_folder = Path('templates')
out_folder.mkdir(exist_ok=True)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment