We use PyYAML which does not ensure any consistent order when loading the file. The natural thing is to use OrderedDict instead.
Existing PR: https://github.com/lago-project/lago/pull/346, fails on something that looks like a bug when using both the yaml merge operator and a custom loader which ensures OrderedDict is used.
Recently, I was playing with anymarkup, a python library which also loads YAMLs as OrderedDict, one option is to check if it happens there too, and if not see what we are missing to make it work.
We use
PyYAML
which does not ensure any consistent order when loading the file. The natural thing is to useOrderedDict
instead. Existing PR: https://github.com/lago-project/lago/pull/346, fails on something that looks like a bug when using both the yaml merge operator and a custom loader which ensuresOrderedDict
is used.Recently, I was playing with anymarkup, a python library which also loads YAMLs as
OrderedDict
, one option is to check if it happens there too, and if not see what we are missing to make it work.Some inspiration: http://stackoverflow.com/questions/38110900/constructorerror-with-yaml-load-while-using-ordereddict-that-support-auto-vivifi http://stackoverflow.com/questions/5121931/in-python-how-can-you-load-yaml-mappings-as-ordereddicts