Automation fix for code update

Changes:
   - New code enhancement is to handle scenario when BMC,
     have single firmware as functional.
     these changes will skip the keyword,
     "Switch Backup Firmware Image To Functional"

Signed-off-by: susilsi7 <susilsi7@in.ibm.com>
Change-Id: I44262ed4f62f95ec99cf2832b6c96d82a91ca3c4
diff --git a/lib/redfish_code_update_utils.robot b/lib/redfish_code_update_utils.robot
index 7f82c1f..40a1595 100644
--- a/lib/redfish_code_update_utils.robot
+++ b/lib/redfish_code_update_utils.robot
@@ -135,6 +135,10 @@
     # functional_state  Functional state can be either True or False.
 
     ${resp}=  Filter Struct  ${sw_inv}  [('functional', ${functional_state})]
+
+    ${num_records}=  Get Length  ${resp}
+    Return From Keyword If  ${num_records} == ${0}  ${EMPTY}
+
     ${list_inv_dict}=  Get Dictionary Values  ${resp}
 
     [Return]  ${list_inv_dict}[0]