From 1e462d9f8650dbe3d904beff225748e42ebbf08b Mon Sep 17 00:00:00 2001 From: Luis Lozano Date: Fri, 18 Apr 2014 17:49:29 -0700 Subject: 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 Commit-Queue: Luis Lozano Tested-by: Luis Lozano --- image_chromeos.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'image_chromeos.py') 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 -- cgit v1.2.3