def __init__(self, session, command, **kwargs): CommandTask.__init__(self, session, ProcessReader, command, **kwargs) stdout = subprocess.PIPE stderr = subprocess.STDOUT if self._combine_stderr else subprocess.PIPE self._proc = subprocess.Popen(command, shell=True, stdout=stdout, stderr=stderr) self._reader.start(self._proc)
def __init__(self, session, command, **kwargs): CommandTask.__init__(self, session, ChannelReader, command, **kwargs) transport = self.session.ssh_client.get_transport() self._ssh_session = transport.open_session() self._ssh_session.set_combine_stderr(self._combine_stderr) self._ssh_session.exec_command(command) self._reader.start(self._ssh_session)