Skip to content

Commit

Permalink
Corrected rf_sensor_list to not assume all excerpts contain a reading
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Raineri <[email protected]>
  • Loading branch information
mraineri committed Aug 3, 2022
1 parent 9b2f961 commit e55c1ea
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 e55c1ea

Please sign in to comment.