Fix robot codes with latest directives
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: Ia7075ebf97e7300a82b032628e550d0caa4e86a8
Signed-off-by: Sridevi Ramesh <sridevra@in.ibm.com>
diff --git a/lib/bmc_network_utils.robot b/lib/bmc_network_utils.robot
index 3188c4f..2a59ff6 100644
--- a/lib/bmc_network_utils.robot
+++ b/lib/bmc_network_utils.robot
@@ -551,9 +551,11 @@
@{network_configurations}= Get Network Configuration
FOR ${network_configuration} IN @{network_configurations}
- Run Keyword If '${network_configuration['Address']}' == '${ip}'
- ... Append To List ${patch_list} ${null}
- ... ELSE Append To List ${patch_list} ${empty_dict}
+ IF '${network_configuration['Address']}' == '${ip}'
+ Append To List ${patch_list} ${null}
+ ELSE
+ Append To List ${patch_list} ${empty_dict}
+ END
END
${ip_found}= Run Keyword And Return Status List Should Contain Value
diff --git a/lib/external_intf/vmi_utils.robot b/lib/external_intf/vmi_utils.robot
index 836e9c8..6d53a6e 100644
--- a/lib/external_intf/vmi_utils.robot
+++ b/lib/external_intf/vmi_utils.robot
@@ -57,8 +57,10 @@
Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED}
${host_power_state} ${host_state}= Redfish Get Host State
- Run Keyword If '${host_power_state}' == 'On' and '${host_state}' == 'Enabled'
- ... Verify VMI Network Interface Details ${ip} Static ${gateway} ${netmask} ${interface}
+ IF '${host_power_state}' == 'On' and '${host_state}' == 'Enabled'
+ Verify VMI Network Interface Details ${ip} Static ${gateway} ${netmask} ${interface}
+ END
+
Verify VMI Network Interface Details
[Documentation] Verify VMI network interface details.
@@ -144,7 +146,7 @@
${ip_exists}= Set Variable If ${ip_resp["IPv4Addresses"]} == @{empty} ${False} ${True}
${static_exists}= Set Variable If ${ip_resp["IPv4StaticAddresses"]} == @{empty} ${False} ${True}
- ${vmi_ip}= Run Keyword If ${ip_exists} == ${True}
+ ${vmi_ip}= Set Variable If ${ip_exists} == ${True}
... Create Dictionary DHCPv4=${${ip_resp["DHCPv4"]["DHCPEnabled"]}} Id=${ip_resp["Id"]}
... Description=${ip_resp["Description"]} IPv4_Address=${ip_resp["IPv4Addresses"][0]["Address"]}
... IPv4_AddressOrigin=${ip_resp["IPv4Addresses"][0]["AddressOrigin"]} Name=${ip_resp["Name"]}
diff --git a/lib/logging_utils.robot b/lib/logging_utils.robot
index 20e6901..c8d244d 100644
--- a/lib/logging_utils.robot
+++ b/lib/logging_utils.robot
@@ -185,15 +185,15 @@
# }
# }
- Run Keyword If '${pel_type}' == 'Internal Failure'
- ... BMC Execute Command ${CMD_INTERNAL_FAILURE}
- ... ELSE IF '${pel_type}' == 'FRU Callout'
- ... BMC Execute Command ${CMD_FRU_CALLOUT}
- ... ELSE IF '${pel_type}' == 'Procedure And Symbolic FRU Callout'
- ... BMC Execute Command ${CMD_PROCEDURAL_SYMBOLIC_FRU_CALLOUT}
- ... ELSE IF '${pel_type}' == 'Unrecoverable Error'
- ... BMC Execute Command ${CMD_UNRECOVERABLE_ERROR}
-
+ IF '${pel_type}' == 'Internal Failure'
+ BMC Execute Command ${CMD_INTERNAL_FAILURE}
+ ELSE IF '${pel_type}' == 'FRU Callout'
+ BMC Execute Command ${CMD_FRU_CALLOUT}
+ ELSE IF '${pel_type}' == 'Procedure And Symbolic FRU Callout'
+ BMC Execute Command ${CMD_PROCEDURAL_SYMBOLIC_FRU_CALLOUT}
+ ELSE IF '${pel_type}' == 'Unrecoverable Error'
+ BMC Execute Command ${CMD_UNRECOVERABLE_ERROR}
+ END
Create Test Error Log
[Documentation] Generate test error log.