Add re-try for redfish GET request for targets
Changes:
- This retries is added to improve the success rate
for the GET request in case returns JSON errors
for the following URI during operation
/redfish/v1/Systems/ and /redfish/v1/Managers/
- Added other places in code to handle exceptions.
- Fix IPMI import paths in test suite
Tested:
- Ran from sandbox.
Change-Id: Ie37dbdd9c7572e0003a56e65a7b5f0a4c3b26a1a
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/bmc_redfish_utils.robot b/lib/bmc_redfish_utils.robot
index 1e8bb10..c4422e8 100644
--- a/lib/bmc_redfish_utils.robot
+++ b/lib/bmc_redfish_utils.robot
@@ -32,7 +32,8 @@
# }
# }
- ${target}= redfish_utils.Get Target Actions /redfish/v1/Systems/${SYSTEM_ID}/ ComputerSystem.Reset
+ ${target}= Wait Until Keyword Succeeds 1 min 20 sec
+ ... redfish_utils.Get Target Actions /redfish/v1/Systems/${SYSTEM_ID}/ ComputerSystem.Reset
${payload}= Create Dictionary ResetType=${reset_type}
${resp}= Redfish.Post ${target} body=&{payload}
... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
@@ -52,7 +53,8 @@
# "target": "/redfish/v1/Managers/${MANAGER_ID}/Actions/Manager.Reset"
# }
- ${target}= redfish_utils.Get Target Actions /redfish/v1/Managers/${MANAGER_ID}/ Manager.Reset
+ ${target}= Wait Until Keyword Succeeds 1 min 20 sec
+ ... redfish_utils.Get Target Actions /redfish/v1/Managers/${MANAGER_ID}/ Manager.Reset
${payload}= Create Dictionary ResetType=${reset_type}
Redfish.Post ${target} body=&{payload}