diff options
author | Ed Tanous <ed.tanous@intel.com> | 2019-07-31 20:59:18 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2019-07-31 20:59:18 +0300 |
commit | b4f66bacb1b8e661d794fa7a189e2f66f5092e2e (patch) | |
tree | 5a8302cd349fdb68dadca003483c61917d4a6add /meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py | |
parent | 43a183cc0926da36e3a218efa02ab4838ace316f (diff) | |
parent | dd755025e33af27b059ea7ef3afbe850e4880b08 (diff) | |
download | openbmc-b4f66bacb1b8e661d794fa7a189e2f66f5092e2e.tar.xz |
Merge branch 'master' of ssh://git-amr-1.devtools.intel.com:29418/openbmc-openbmc into intel
Diffstat (limited to 'meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py')
-rwxr-xr-x | meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py index 5e6c4b5e6..877e3eb57 100755 --- a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py @@ -12,6 +12,11 @@ import sys import yaml import copy +# Custom representer for None types. This is to handle empty dictionaries. +# By default Pyyaml outputs these as "null", whereas we want an empty character. +def represent_none(self, _): + return self.represent_scalar('tag:yaml.org,2002:null', '') + def dict_merge(target, source): """Deep merge for dicts. @@ -43,6 +48,8 @@ if len(sys.argv) == 2: # No overrides to handle sys.exit(0) +yaml.add_representer(type(None), represent_none) + target_filename = sys.argv[1] with open(target_filename) as target_file: data = yaml.safe_load(target_file) |