Stop ssh from needlessly consuming stdin.

Add -n to remote_sh calls in set_up_remote_access and learn_board.
Otherwise the ssh's they start will consume some stdin, making these
functions incompatible with a script which needs its stdin.

BUG=none
TEST=add -n to first remote_sh in cros_adopt_device then "echo y | cros_adopt_device" will work

Change-Id: Ic01f69b0a86581c8650f59056d52766e76de1799
Reviewed-on: https://gerrit.chromium.org/gerrit/37251
Tested-by: Frank Henigman <fjhenigman@chromium.org>
Reviewed-by: Chris Wolfe <cwolfe@chromium.org>
Commit-Ready: Frank Henigman <fjhenigman@chromium.org>
This commit is contained in:
Frank Henigman 2012-11-02 13:47:16 -04:00 committed by Gerrit
parent 782425697f
commit d6b6cf6751

View File

@ -91,7 +91,7 @@ set_up_remote_access() {
# Verify the client is reachable before continuing
local output
local status=0
if output=$(remote_sh "true" 2>&1); then
if output=$(remote_sh -n "true" 2>&1); then
:
else
status=$?
@ -104,7 +104,7 @@ set_up_remote_access() {
# Ask the target what board it is
learn_board() {
[ -n "${FLAGS_board}" ] && return
remote_sh grep CHROMEOS_RELEASE_BOARD /etc/lsb-release
remote_sh -n grep CHROMEOS_RELEASE_BOARD /etc/lsb-release
FLAGS_board=$(echo "${REMOTE_OUT}" | cut -d '=' -f 2)
if [ -z "${FLAGS_board}" ]; then
error "Board required"