Replace deprecated keywords for lib
Changes:
- Run KeyWord If is deprecated since Robot
Framework version 5.*, use 'IF' instead
Tested:
- Checked using robot dry-run to make sure the
syntax is not broken
Change-Id: I4e1418fad55b736d35e47c1fca1175baaab2f0b4
Signed-off-by: Sridevi Ramesh <sridevra@in.ibm.com>
diff --git a/lib/bmc_redfish_utils.robot b/lib/bmc_redfish_utils.robot
index 26aec0a..25d4dc8 100644
--- a/lib/bmc_redfish_utils.robot
+++ b/lib/bmc_redfish_utils.robot
@@ -202,10 +202,12 @@
${context_var}= Get Variable Value ${resp.dict["Context"]} ${EMPTY}
# Handle backward compatibility for OEM.
${oem_var}= Get Variable Value ${resp.dict["Oem"]["OpenBMC"]["ClientID"]} ${EMPTY}
- Run Keyword If '${context_var}' != '${EMPTY}'
- ... Append To List ${client_id_sessions} ${session}
- Run Keyword If '${oem_var}' != '${EMPTY}'
- ... Append To List ${client_id_sessions} ${session}
+ IF '${context_var}' != '${EMPTY}'
+ Append To List ${client_id_sessions} ${session}
+ END
+ IF '${oem_var}' != '${EMPTY}'
+ Append To List ${client_id_sessions} ${session}
+ END
END
RETURN ${client_id_sessions}
@@ -298,17 +300,19 @@
${user_exists}= Run Keyword And Return Status Should Be Equal As Strings ${curr_role}[0] PASS
# Delete user account when force is True.
- Run Keyword If ${force} == ${True} Redfish.Delete ${REDFISH_ACCOUNTS_URI}${user_name}
- ... valid_status_codes=[${HTTP_OK}, ${HTTP_NOT_FOUND}]
+ IF ${force} == ${True}
+ Redfish.Delete ${REDFISH_ACCOUNTS_URI}${user_name}
+ ... valid_status_codes=[${HTTP_OK}, ${HTTP_NOT_FOUND}]
+ END
# Create specified user when force is True or User does not exist.
${payload}= Create Dictionary
... UserName=${user_name} Password=${password} RoleId=${role_id} Enabled=${enabled}
- Run Keyword If ${force} == ${True} or ${user_exists} == ${False}
- ... Redfish.Post ${REDFISH_ACCOUNTS_URI} body=&{payload}
- ... valid_status_codes=[${HTTP_CREATED}]
-
+ IF ${force} == ${True} or ${user_exists} == ${False}
+ Redfish.Post ${REDFISH_ACCOUNTS_URI} body=&{payload}
+ ... valid_status_codes=[${HTTP_CREATED}]
+ END
Get User Role
[Documentation] Get User Role.