summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarri Devender Rao <devenrao@in.ibm.com>2017-08-21 03:42:31 -0500
committerPatrick Williams <patrick@stwcx.xyz>2017-09-13 21:29:32 +0000
commit9606ba3efe9d61458ad2ede6f0639856d580ef7e (patch)
treef15ef518c6c59dcaf593f43e42504086f24b9c79
parent2796bf909d81dbc93e823c57b9083dd0e19b0c27 (diff)
downloadipmi-fru-parser-9606ba3efe9d61458ad2ede6f0639856d580ef7e.zip
ipmi-fru-parser-9606ba3efe9d61458ad2ede6f0639856d580ef7e.tar.gz
Modify mako script to generate code for empty interfaces
Allow generating code for empty interfaces in the FRU map. Empty interfaces are used to determine the type of the inventory object. Change-Id: I945998627b88bc68374b631d1b14328cd611cb39 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
-rw-r--r--scripts/example.yaml5
-rw-r--r--scripts/writefru.mako.cpp12
2 files changed, 12 insertions, 5 deletions
diff --git a/scripts/example.yaml b/scripts/example.yaml
index a9543ba..69d7ebd 100644
--- a/scripts/example.yaml
+++ b/scripts/example.yaml
@@ -33,6 +33,7 @@
Version:
IPMIFruProperty: Version
IPMIFruSection: Product
+ xyz.openbmc_project.Inventory.Item.System:
1:
/system/chassis/motherboard/dimm0:
xyz.openbmc_project.Inventory.Item:
@@ -56,6 +57,7 @@
Version:
IPMIFruProperty: Version
IPMIFruSection: Product
+ xyz.openbmc_project.Inventory.Item.Dimm:
2:
/system/chassis/motherboard/dimm1:
xyz.openbmc_project.Inventory.Item:
@@ -79,6 +81,7 @@
Version:
IPMIFruProperty: Version
IPMIFruSection: Product
+ xyz.openbmc_project.Inventory.Item.Dimm:
3:
/system/chassis/motherboard/cpu0:
xyz.openbmc_project.Inventory.Item:
@@ -98,6 +101,7 @@
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Board
+ xyz.openbmc_project.Inventory.Item.Cpu:
4:
/system/chassis/motherboard/cpu1:
xyz.openbmc_project.Inventory.Item:
@@ -117,3 +121,4 @@
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Board
+ xyz.openbmc_project.Inventory.Item.Cpu:
diff --git a/scripts/writefru.mako.cpp b/scripts/writefru.mako.cpp
index 82941a4..0a0a14f 100644
--- a/scripts/writefru.mako.cpp
+++ b/scripts/writefru.mako.cpp
@@ -12,10 +12,11 @@ extern const FruMap frus = {
{"${object}",{
% for interface,properties in interfaces.items():
{"${interface}",{
- % for dbus_property,property_value in properties.items():
- {"${dbus_property}",{
- "${property_value.get("IPMIFruSection", "")}",
- "${property_value.get("IPMIFruProperty", "")}", \
+ % if properties:
+ % for dbus_property,property_value in properties.items():
+ {"${dbus_property}",{
+ "${property_value.get("IPMIFruSection", "")}",
+ "${property_value.get("IPMIFruProperty", "")}", \
<%
delimiter = property_value.get("IPMIFruValueDelimiter")
if not delimiter:
@@ -25,7 +26,8 @@ extern const FruMap frus = {
%>
"${delimiter}"
}},
- % endfor
+ % endfor
+ %endif
}},
% endfor
}},
OpenPOWER on IntegriCloud