summaryrefslogtreecommitdiff
path: root/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py
diff options
context:
space:
mode:
authorSantosh Puranik <santosh.puranik@in.ibm.com>2019-05-07 12:15:50 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2019-05-23 21:58:07 +0300
commit1b2908fe677a3d46de1a1318013281fda2793af4 (patch)
tree646ea819f75c39e5badc68e76102e221ac4e8aa8 /meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py
parente9b0fe9e17d4fa69d3eecf7e48243308aa05f240 (diff)
downloadopenbmc-1b2908fe677a3d46de1a1318013281fda2793af4.tar.xz
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. (From meta-phosphor rev: f510f7b6b708b22db1f08faf369994f01edd0ddc) Signed-off-by: Santosh Puranik <santosh.puranik@in.ibm.com> Change-Id: I213c4af2e5b09b8a9cd5d37409f37fc7c075a013 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py')
-rwxr-xr-xmeta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py7
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)