Skip to content

Commit

Permalink
Merge pull request #86 from DMTF/Sensor-Property-Hardening
Browse files Browse the repository at this point in the history
Corrected rf_sensor_list to not assume all excerpts contain a reading
  • Loading branch information
mraineri authored Aug 5, 2022
2 parents f53bbd3 + e55c1ea commit bc8a402
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions redfish_utilities/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def get_excerpt_status( name, field, units, object, readings ):
if "DataSourceUri" not in item:
reading = {
"Name": "{} {} {}".format( name, field, i ),
"Reading": item["Reading"],
"Reading": item.get( "Reading", None ),
"Units": units,
"State": None,
"Health": None,
Expand All @@ -344,7 +344,7 @@ def get_excerpt_status( name, field, units, object, readings ):
if "DataSourceUri" not in object[field]:
reading = {
"Name": "{} {}".format( name, field ),
"Reading": object[field]["Reading"],
"Reading": object[field].get( "Reading", None ),
"Units": units,
"State": None,
"Health": None,
Expand Down

0 comments on commit bc8a402

Please sign in to comment.