mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-28 05:51:43 +01:00
Remove ssh verboseness spew.
This CL removes verboseness when running ssh commands through remote_access.sh while preserving the retry. BUG=chromium-os:20985 TEST=Ran image_to_live. Change-Id: I26bc5189f369dc2305442755a266b80b27aa2ed7 Reviewed-on: https://gerrit.chromium.org/gerrit/16856 Tested-by: Chris Sosa <sosa@chromium.org> Reviewed-by: Don Garrett <dgarrett@chromium.org> Commit-Ready: Chris Sosa <sosa@chromium.org>
This commit is contained in:
parent
650bf873cd
commit
539b341dec
@ -33,14 +33,7 @@ function remote_rsync_from() {
|
||||
--no-R --files-from=$1 root@${FLAGS_remote}:/ $2
|
||||
}
|
||||
|
||||
function _verbose_remote_sh() {
|
||||
REMOTE_OUT=$(ssh -vp ${FLAGS_ssh_port} $SSH_CONNECT_SETTINGS \
|
||||
-o UserKnownHostsFile=$TMP_KNOWN_HOSTS -i $TMP_PRIVATE_KEY \
|
||||
root@$FLAGS_remote "$@")
|
||||
return ${PIPESTATUS[0]}
|
||||
}
|
||||
|
||||
function _non_verbose_remote_sh() {
|
||||
function _remote_sh() {
|
||||
REMOTE_OUT=$(ssh -p ${FLAGS_ssh_port} $SSH_CONNECT_SETTINGS \
|
||||
-o UserKnownHostsFile=$TMP_KNOWN_HOSTS -i $TMP_PRIVATE_KEY \
|
||||
root@$FLAGS_remote "$@")
|
||||
@ -48,13 +41,13 @@ function _non_verbose_remote_sh() {
|
||||
}
|
||||
|
||||
# Wrapper for ssh that runs the commmand given by the args on the remote host
|
||||
# If an ssh error occurs, re-runs the ssh command with verbose flag set.
|
||||
# If an ssh error occurs, re-runs the ssh command.
|
||||
function remote_sh() {
|
||||
local ssh_status=0
|
||||
_non_verbose_remote_sh "$@" || ssh_status=$?
|
||||
_remote_sh "$@" || ssh_status=$?
|
||||
# 255 indicates an ssh error.
|
||||
if [ ${ssh_status} -eq 255 ]; then
|
||||
_verbose_remote_sh "$@"
|
||||
_remote_sh "$@"
|
||||
else
|
||||
return ${ssh_status}
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user