More readable log message for ExecuteCommandOnRemoteSystem 67/38967/1
authorJozef Behran <jbehran@cisco.com>
Tue, 17 May 2016 12:26:50 +0000 (14:26 +0200)
committerJozef Behran <jbehran@cisco.com>
Tue, 17 May 2016 12:31:08 +0000 (14:31 +0200)
The original logging command produced a message like
"Attempting to execute sudo /sbin/iptables -I OUTPUT -p all
--source 10.30.32.162 --destination 10.30.32.204 -j DROP on
10.30.32.162 by jenkins with any and >" which is pretty
confusing as it is not clear what part is the command to be
execute, what part is the remote system to be executed and
so on.

The new format is something like 'Attempting to execute
command "sudo /sbin/iptables -I OUTPUT -p all --source
10.30.32.162 --destination 10.30.32.204 -j DROP" on remote
system "10.30.32.162" by user "jenkins" with keyfile "any"
and prompt ">"' which is far more readable as now the
message described each of the items it contains and also
uses quotes to make it explicit where the items start and
end in the message.

Change-Id: I886059bd7bae6ebde866977a49b4bf6eb63354d1
Signed-off-by: Jozef Behran <jbehran@cisco.com>
csit/libraries/Utils.robot

index d9bfedfc8231611255c46a0c8f52c63d808524e4..13b1dd1b29db890d5f4c5de847c1a6e231ef6446 100644 (file)
@@ -233,7 +233,7 @@ Run Command On Remote System
     ...    robot keyword, taking care to log in with a public key and. The command given is written
     ...    and the output returned. No test conditions are checked.
     ${current_ssh_connection}=    SSHLibrary.Get Connection
-    Log    Attempting to execute ${cmd} on ${system} by ${user} with ${keyfile_pass} and ${prompt}
+    Log    Attempting to execute command "${cmd}" on remote system "${system}" by user "${user}" with keyfile pass "${keyfile_pass}" and prompt "${prompt}"
     ${conn_id}=    SSHLibrary.Open Connection    ${system}    prompt=${prompt}    timeout=${prompt_timeout}
     Flexible SSH Login    ${user}    ${password}
     ${stdout}    ${stderr}    SSHLibrary.Execute Command    ${cmd}    return_stderr=True