Make json and yaml files conflict instead of override

This commit is contained in:
Anders Ingemann 2014-12-19 01:26:33 +01:00
parent e9137ac172
commit 71e0d943fc

View file

@ -5,11 +5,11 @@ from bootstrapvz.common.tools import load_data
partial_json = glob.glob(os.path.join(os.path.dirname(__file__), '*.yml'))
partial_yaml = glob.glob(os.path.join(os.path.dirname(__file__), '*.json'))
def dictkey(path):
return
# yaml overrides json
partials = {}
for path in partial_json + partial_yaml:
key = os.path.splitext(os.path.basename(path))[0]
if key in partials:
msg = 'Error when loading partial manifests: The partial {key} exists twice'.format(key=key)
raise Exception(msg)
partials[key] = load_data(path)