Skip to content
Snippets Groups Projects
Commit 8f07f831 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Add “tty” parameter to SshRunner.BuildCmd

This allows callers to allocate a pseudo-TTY easily.

Reviewed-by: ultrotter
parent bf3d57b8
No related branches found
No related tags found
No related merge requests found
......@@ -90,7 +90,8 @@ class SshRunner:
"""Wrapper for SSH commands.
"""
def BuildCmd(self, hostname, user, command, batch=True, ask_key=False):
def BuildCmd(self, hostname, user, command, batch=True, ask_key=False,
tty=False):
"""Build an ssh command to execute a command on a remote node.
Args:
......@@ -114,6 +115,8 @@ class SshRunner:
argv.extend(BATCH_MODE_OPTS)
elif ask_key:
argv.extend(ASK_KEY_OPTS)
if tty:
argv.append("-t")
argv.extend(["%s@%s" % (user, hostname), command])
return argv
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment