Add ignorestatus=1 to ssh_host.run
Signed-off-by: Ryan Stutsman <stutsman@google.com>
This adds an option to Host.run and utils.run to suppress exceptions.
This keeps one from having to perpetually catch exceptions if several
commands that may potentially fail have to be run.
git-svn-id: http://test.kernel.org/svn/autotest/trunk@586 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/hosts/ssh_host.py b/server/hosts/ssh_host.py
index eb4a301..b5a24df 100644
--- a/server/hosts/ssh_host.py
+++ b/server/hosts/ssh_host.py
@@ -62,7 +62,7 @@
except errors.AutoservRunError:
pass
- def run(self, command, timeout=None):
+ def run(self, command, timeout=None, ignore_status=False):
"""Run a command on the remote host.
Args:
@@ -82,7 +82,7 @@
#~ print "running %s" % (command,)
result= utils.run(r'ssh -l %s -p %d %s "%s"' % (self.user,
self.port, self.hostname, utils.sh_escape(command)),
- timeout)
+ timeout, ignore_status)
return result
def reboot(self):