Fixed 'Initiate OS Host Power Off' to work with non root username.

When using a OS_USERNAME that is not root (e.g. "ubuntu"),
'Initiate OS Host Power Off' fails because the user does not have the
authority to do 'shutdown'. Added code to do shutdown with "sudo".

Change-Id: Ie9cdadda393f98381a1edf028dd064d76c465d6e
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index e68dd90..1e3f53e 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -215,11 +215,13 @@
     # 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.
 
-    SSHLibrary.Open connection  ${os_host}
-    Login  ${os_username}  ${os_password}
-    ${cmd_buf}  Catenate  shutdown
-    Start Command  ${cmd_buf}
-    SSHLibrary.Close Connection
+    ${cmd_buf}=  Run Keyword If  '${os_username}' == 'root'
+    ...      Set Variable  shutdown
+    ...  ELSE
+    ...      Set Variable  echo ${os_password} | sudo -S shutdown
+
+    ${output}  ${stderr}  ${rc}=  OS Execute Command
+    ...  ${cmd_buf}  fork=${1}
 
 Initiate OS Host Reboot
     [Documentation]  Initiate an OS reboot.