diff options
author | Luis Lozano <llozano@chromium.org> | 2014-04-21 13:58:16 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-04-22 06:25:54 +0000 |
commit | dd75bad34c994c9f3638a83798aedab363e469f1 (patch) | |
tree | fc69b7c3160dc3d672689c134f0e2c18259bc8aa /image_chromeos.py | |
parent | 1e462d9f8650dbe3d904beff225748e42ebbf08b (diff) | |
download | toolchain-utils-dd75bad34c994c9f3638a83798aedab363e469f1.tar.gz |
Use CrosRunCommand to find if cherrypy is available. Fixed bug in CrosRunCommand
Call CrosRunCommand instead of calling ssh directly to find if cherrypy
is available.
Also fix bug in CrosRunCommand. The retval returned was always 0.
BUG=None
TEST=Reproduced with small test cases.
Change-Id: I277416b1809eb7287a75bd224b4154f442132a52
Reviewed-on: https://chrome-internal-review.googlesource.com/161123
Reviewed-by: Han Shen <shenhan@google.com>
Tested-by: Luis Lozano <llozano@chromium.org>
Commit-Queue: Caroline Tice <cmtice@google.com>
Diffstat (limited to 'image_chromeos.py')
-rwxr-xr-x | image_chromeos.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/image_chromeos.py b/image_chromeos.py index 60e1e9eb..460215ae 100755 --- a/image_chromeos.py +++ b/image_chromeos.py @@ -47,15 +47,10 @@ def CheckForCrosFlash(chromeos_root, remote, log_level): chroot_has_cros_flash = True # Check to see if remote machine has cherrypy. - keypath = os.path.join (os.path.realpath(chromeos_root), - "src/scripts/mod_for_test_scripts/ssh_keys/" - "testing_rsa") - - 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) + command = "python -c 'import cherrypy'" + retval = cmd_executer.CrosRunCommand (command, + chromeos_root=chromeos_root, + machine=remote) logger.GetLogger().LogFatalIf(retval == 255, "Failed ssh to %s" % remote) if retval == 0: remote_has_cherrypy = True |