summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepak Kodihalli <dkodihal@in.ibm.com>2017-09-11 23:04:33 -0500
committerDeepak Kodihalli <dkodihal@in.ibm.com>2017-09-11 23:36:34 -0500
commitdb12d763fba2c781af3490b01edc1a5e8f393426 (patch)
tree99bef2706314022186c25142471f6376d9d46ae8
parent7e7821c68cc4c693d1449da62fbbda840bcace24 (diff)
downloadopenpower-vpd-parser-db12d763fba2c781af3490b01edc1a5e8f393426.tar.gz
openpower-vpd-parser-db12d763fba2c781af3490b01edc1a5e8f393426.zip
vpd source: enable choosing one of many keywords
Invert the property,keyword map. For example, change MACAddress: VINI,B1 to VINI,B1: MACAddress. Change the mako template to handle this. This will allow us to pick VPD information from one of many record/keyword combinations that can source an individual property. Change-Id: I9785652addb88388751fd9f031f8e96e6d7d9df1 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
-rwxr-xr-xwritefru.mako.hpp9
-rw-r--r--writefru.yaml18
2 files changed, 14 insertions, 13 deletions
diff --git a/writefru.mako.hpp b/writefru.mako.hpp
index 7bbd079..e27005f 100755
--- a/writefru.mako.hpp
+++ b/writefru.mako.hpp
@@ -55,10 +55,13 @@ void writeFru<Fru::${key}>(const Store& vpdStore,
% for name, value in properties.iteritems():
% if fru and interface and name and value:
<%
- record, keyword = value.split(",")
+ record, keyword = name.split(",")
%>\
- ${intfName}Props["${name}"] =
- vpdStore.get<Record::${record}, record::Keyword::${keyword}>();
+ if (vpdStore.exists<Record::${record}, record::Keyword::${keyword}>())
+ {
+ ${intfName}Props["${value}"] =
+ vpdStore.get<Record::${record}, record::Keyword::${keyword}>();
+ }
% endif
% endfor
// Check and update extra properties
diff --git a/writefru.yaml b/writefru.yaml
index 0b4802d..eb7f827 100644
--- a/writefru.yaml
+++ b/writefru.yaml
@@ -1,17 +1,15 @@
BMC:
xyz.openbmc_project.Inventory.Decorator.Asset:
- PartNumber: VINI,PN
- SerialNumber: VINI,SN
- Manufacturer: OPFR,VN
- org.openpower_project.Inventory.Decorator.Asset:
- CCIN: VINI,CC
+ VINI,PN: PartNumber
+ VINI,SN: SerialNumber
+ OPFR,VN: Manufacturer
xyz.openbmc_project.Inventory.Item:
- PrettyName: VINI,DR
- xyz.openbmc_project.Inventory.Decorator.Revision:
- Version: VINI,HW
+ VINI,DR: PrettyName
xyz.openbmc_project.Common.UUID:
- UUID: OPFR,UD
+ OPFR,UD: UUID
+
ETHERNET:
xyz.openbmc_project.Inventory.Item.NetworkInterface:
- MACAddress: VINI,B1
+ VINI,B1: MACAddress
+ OPFR,B1: MACAddress
OpenPOWER on IntegriCloud