utils library robot code with the latest directives
Changes:
- Run Keyword If is deprecated since Robot
Framework version 5.*, use 'IF' instead
Tested: - Tested with dry-run option changes
Change-Id: I316abc34727b77489d664eebc6a4ecbd7730bf9d
Signed-off-by: Raghavendra Prabhu <Raghav.Prabhu@ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index e25b0a5..844d141 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -167,10 +167,8 @@
# os_username The username to be used to sign in to the OS.
# os_password The password to be used to sign in to the OS.
- ${cmd_buf}= Run Keyword If '${os_username}' == 'root'
- ... Set Variable reboot
- ... ELSE
- ... Set Variable echo ${os_password} | sudo -S reboot
+ ${cmd_buf}= Set Variable If '${os_username}' == 'root' reboot
+ ... echo ${os_password} | sudo -S reboot
${output} ${stderr} ${rc}= OS Execute Command
... ${cmd_buf} fork=${1}
@@ -187,13 +185,11 @@
# os_password The password to be used to sign in to the OS.
# hard Indicates whether to do a hard vs. soft power off.
- ${time_string}= Run Keyword If ${hard} Set Variable ${SPACE}now
- ... ELSE Set Variable ${EMPTY}
+ ${time_string}= Set Variable If ${hard} ${SPACE}now
+ ... ${EMPTY}
- ${cmd_buf}= Run Keyword If '${os_username}' == 'root'
- ... Set Variable shutdown${time_string}
- ... ELSE
- ... Set Variable echo ${os_password} | sudo -S shutdown${time_string}
+ ${cmd_buf}= Set Variable If '${os_username}' == 'root' shutdown${time_string}
+ ... echo ${os_password} | sudo -S shutdown${time_string}
${output} ${stderr} ${rc}= OS Execute Command
... ${cmd_buf} fork=${1}
@@ -301,10 +297,11 @@
# the console.
Set Boot Progress Method
- ${state}= Run Keyword If '${boot_prog_method}' == 'New'
- ... New Get Boot Progress quiet=${quiet}
- ... ELSE
- ... Old Get Boot Progress quiet=${quiet}
+ IF '${boot_prog_method}' == 'New'
+ ${state}= New Get Boot Progress quiet=${quiet}
+ ELSE
+ ${state}= Old Get Boot Progress quiet=${quiet}
+ END
RETURN ${state}