Accelerator interface for sensorinventory items

This commit adds the xyz.openbmc_project.inventory.Item.Accelerator
interface to GPU inventory items. This is needed so that the inventory
DBUS objects can be queried based on the interface they implement
(using the mapper).

Changes made to merge_yamls script to support interfaces that contain
no properties. This will need a corresponding change in the
phosphor-host-ipmi repo to support empty DBUS interfaces.
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-host-ipmid/+/21106

Tested:
Verified that the merged YAML file containing sensor config information
has now an empty interface xyz.openbmc_project.Inventory.Item.Accelerator
for the GV100 GPU sensors.

Signed-off-by: Santosh Puranik <santosh.puranik@in.ibm.com>
Change-Id: Ic9ac3442def74c922acb805bb7759aa623be9d4f
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)
diff --git a/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-config/config.yaml b/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-config/config.yaml
index ec82afe..8188612 100644
--- a/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-config/config.yaml
+++ b/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-config/config.yaml
@@ -207,6 +207,7 @@
             type: "bool"
             assert: true
             deassert: false
+    xyz.openbmc_project.Inventory.Item.Accelerator:
 # Field replaceable doesn't come as a sensor data
 # but we know that GPU is Field replaceable so setting
 # true in both cases.