| |
@@ -248,13 +248,13 @@
|
| |
self.log.info('MKDIR %s', path)
|
| |
self.sftp.mkdir(path)
|
| |
|
| |
- def start_shell(self, argv, log_stdout=True):
|
| |
+ def start_shell(self, argv, log_stdout=True, get_pty=False):
|
| |
logger_name = self.get_next_command_logger_name()
|
| |
ssh = self._transport.open_channel('session')
|
| |
self.log.info('RUN %s', argv)
|
| |
return SSHCommand(ssh, argv, logger_name=logger_name,
|
| |
log_stdout=log_stdout,
|
| |
- get_logger=self.host.config.get_logger)
|
| |
+ get_logger=self.host.config.get_logger, get_pty=get_pty)
|
| |
|
| |
def get_file(self, remotepath, localpath):
|
| |
self.log.debug('GET %s', remotepath)
|
| |
@@ -432,7 +432,7 @@
|
| |
class SSHCommand(Command):
|
| |
"""Command implementation for ParamikoTransport and OpenSSHTranspport"""
|
| |
def __init__(self, ssh, argv, logger_name, log_stdout=True,
|
| |
- collect_output=True, encoding='utf-8', get_logger=None):
|
| |
+ collect_output=True, encoding='utf-8', get_logger=None, get_pty=False):
|
| |
super(SSHCommand, self).__init__(argv, logger_name,
|
| |
log_stdout=log_stdout,
|
| |
get_logger=get_logger)
|
| |
@@ -443,6 +443,9 @@
|
| |
self._ssh = ssh
|
| |
|
| |
self.log.debug('RUN %s', argv)
|
| |
+
|
| |
+ if get_pty:
|
| |
+ self._ssh.get_pty()
|
| |
|
| |
self._ssh.invoke_shell()
|
| |
def wrap_file(file, encoding):
|
| |
Signed-off-by: Niranjan M.R mrniranjan@redhat.com