diff options
author | Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com> | 2017-10-03 03:58:05 -0500 |
---|---|---|
committer | Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com> | 2017-10-11 10:17:12 -0500 |
commit | e245e4e932279a112325dae06d7c12cf9e8ed833 (patch) | |
tree | 0be93f1578b547b6911c1f09f4c70b259e67b2a7 /scripts/writesensor.mako.cpp | |
parent | e84841ce7e833d527709c557e9e25829f4e3893c (diff) | |
download | phosphor-host-ipmid-e245e4e932279a112325dae06d7c12cf9e8ed833.tar.gz phosphor-host-ipmid-e245e4e932279a112325dae06d7c12cf9e8ed833.zip |
IPMI changes to mark non present as non functional
When marking a unit as functional, both functional state
and presence need to be checked to avoid marking non-present
units as functional.
Change-Id: If7b710c39f1c2590b82378ebdb7014dc924599ff
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
Diffstat (limited to 'scripts/writesensor.mako.cpp')
-rw-r--r-- | scripts/writesensor.mako.cpp | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/scripts/writesensor.mako.cpp b/scripts/writesensor.mako.cpp index 9cd4e48..c5db13a 100644 --- a/scripts/writesensor.mako.cpp +++ b/scripts/writesensor.mako.cpp @@ -51,7 +51,7 @@ extern const IdInfoMap sensors = { if "readingAssertion" == valueReadingType or "readingData" == valueReadingType: for interface,properties in interfaces.items(): for dbus_property,property_value in properties.items(): - for offset,values in property_value.items(): + for offset,values in property_value["Offsets"].items(): valueType = values["type"] updateFunc = "set::" + valueReadingType + "<" + valueType + ">" getFunc = "get::" + valueReadingType + "<" + valueType + ">" @@ -66,7 +66,28 @@ extern const IdInfoMap sensors = { {"${interface}",{ % for dbus_property,property_value in properties.items(): {"${dbus_property}",{ - % for offset,values in property_value.items(): +<% +try: + preReq = property_value["Prereqs"] +except KeyError, e: + preReq = dict() +%>\ + { + % for preOffset,preValues in preReq.items(): + { ${preOffset},{ + % for name,value in preValues.items(): + % if name == "type": +<% continue %>\ + % endif +<% value = str(value).lower() %>\ + ${value}, + % endfor + } + }, + % endfor + }, + { + % for offset,values in property_value["Offsets"].items(): { ${offset},{ % if offset == 0xFF: }}, @@ -102,11 +123,11 @@ except KeyError, e: } }, % endfor - }}, + }}}, % endfor }}, % endfor - }, + } }}, % endif % endfor |