aboutsummaryrefslogtreecommitdiff
path: root/image_chromeos.py
diff options
context:
space:
mode:
authorLuis Lozano <llozano@chromium.org>2014-04-18 17:49:29 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-04-22 04:32:36 +0000
commit1e462d9f8650dbe3d904beff225748e42ebbf08b (patch)
tree21a48493de8ab4c8dde29d0dacb5c4557027fb70 /image_chromeos.py
parent98a53692fb946a8eac46e3e82257f540d1350c18 (diff)
downloadtoolchain-utils-1e462d9f8650dbe3d904beff225748e42ebbf08b.tar.gz
Fixed command to figure out if cherrypi is available on the DUT
Figured out why we sometimes we were not using cros flash for imaging the machines. It turns out the ssh command used was incorrect and (did not specify an empty file for the known hosts) so it will sometimes will fail when connecting to the DUT. There was another problem because the code assumed a return value of non-zero meant cherrypi was not available. We know also check for error code 255 which means the ssh itself failed (not the remote command). BUG=None TEST=Imaged a machine Change-Id: I7c5cef859b73bc9f2a777825914a1c1bb162704b Reviewed-on: https://chrome-internal-review.googlesource.com/161009 Reviewed-by: Han Shen <shenhan@google.com> Commit-Queue: Luis Lozano <llozano@chromium.org> Tested-by: Luis Lozano <llozano@chromium.org>
Diffstat (limited to 'image_chromeos.py')
-rwxr-xr-ximage_chromeos.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/image_chromeos.py b/image_chromeos.py
index 2b403588..60e1e9eb 100755
--- a/image_chromeos.py
+++ b/image_chromeos.py
@@ -51,10 +51,12 @@ def CheckForCrosFlash(chromeos_root, remote, log_level):
"src/scripts/mod_for_test_scripts/ssh_keys/"
"testing_rsa")
- command = ("ssh -q -i %s -o StrictHostKeyChecking=no -o CheckHostIP=no "
- "-o BatchMode=yes root@%s \"python -c 'import cherrypy'\" " %
+ command = ("ssh -i %s -o StrictHostKeyChecking=no -o CheckHostIP=no "
+ "-o BatchMode=yes -o UserKnownHostsFile=/dev/null "
+ "root@%s \"python -c 'import cherrypy'\" " %
(keypath,remote) )
retval = cmd_executer.RunCommand (command)
+ logger.GetLogger().LogFatalIf(retval == 255, "Failed ssh to %s" % remote)
if retval == 0:
remote_has_cherrypy = True