Revert "Revert "Accelerator interface for sensorinventory items""

This reverts commit 7fb0c049d3a290c8f9d7f7c9690cdef9a97b3c52.

Restore function reverted by
7fb0c049d3a290c8f9d7f7c9690cdef9a97b3c52, swift build issue
has now been resolved.

Signed-off-by: Santosh Puranik <santosh.puranik@in.ibm.com>
Change-Id: I948b2ccb8b0ae5a11f6cd41b766a5819fea1b567
diff --git a/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py b/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py
index 5e6c4b5..877e3eb 100755
--- a/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py
+++ b/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py
@@ -12,6 +12,11 @@
 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 @@
     # 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)