[autotest] add a --ssh_options option to autoserv
This CL follows the template of
https://chromium-review.googlesource.com/167415
BUG=chromium:285378
TEST=Unit tests pass. Manually verified that specifying
--ssh_options="-F /dev/null -i /dev/null" caused those flags to be
threaded into ssh commands.
Change-Id: Ie0496862d05d42192d55501fc0ed1c3a6274fe79
Reviewed-on: https://chromium-review.googlesource.com/168099
Reviewed-by: Aviv Keshet <[email protected]>
Tested-by: Aviv Keshet <[email protected]>
Commit-Queue: Aviv Keshet <[email protected]>
diff --git a/server/autoserv_utils.py b/server/autoserv_utils.py
index 752de22..69ac3f7 100644
--- a/server/autoserv_utils.py
+++ b/server/autoserv_utils.py
@@ -14,7 +14,8 @@
queue_entry=None, verbose=True,
write_pidfile=True, fast_mode=False,
ssh_verbosity=0,
- no_console_prefix=False):
+ no_console_prefix=False,
+ ssh_options=None,):
"""
Construct an autoserv command from a job or host queue entry.
@@ -39,6 +40,8 @@
verbosity level of ssh. Default: 0.
@param no_console_prefix: If true, supress timestamps and other prefix info
in autoserv console logs.
+ @param ssh_options: A string giving extra arguments to be tacked on to
+ ssh commands.
@returns The autoserv command line as a list of executable + parameters.
"""
command = [os.path.join(autoserv_directory, 'autoserv')]
@@ -55,6 +58,9 @@
if ssh_verbosity:
command += ['--ssh_verbosity', str(ssh_verbosity)]
+ if ssh_options:
+ command += ['--ssh_options', ssh_options]
+
if no_console_prefix:
command += ['--no_console_prefix']