Fix fan presence test when fan property Present is absent
Resolves openbmc/openbmc-test-automation#1416
Change-Id: I629f2346051326f7c4a058c772b9056fb346b756
Signed-off-by: Steven Sombar <ssombar@us.ibm.com>
diff --git a/lib/fan_utils.robot b/lib/fan_utils.robot
index 6ad0a40..43fcddc 100755
--- a/lib/fan_utils.robot
+++ b/lib/fan_utils.robot
@@ -16,7 +16,7 @@
Get Fan Names
- [Documentation] Get the names of fans marked present in inventory.
+ [Documentation] Get the names of the fans marked present in inventory.
[Arguments] ${fan_names}
# This keyword populates the fan_names list with the names of
# fans present in inventory e.g. fan0, fan2, fan3.
@@ -27,8 +27,10 @@
${fan_uris}= Get Endpoint Paths ${HOST_INVENTORY_URI}/system fan
: FOR ${fan_uri} IN @{fan_uris}
+
\ ${fan_properties}= Read Properties ${fan_uri}
- \ Continue For Loop If ${fan_properties['Present']} != 1
+ \ ${fan_present}= Get Variable Value ${fan_properties['Present']} 0
+ \ Continue For Loop If ${fan_present} != 1
\ ${remaining_uri} ${fan_name}= Split Path ${fan_uri}
\ Append To List ${fan_names} ${fan_name}