Esempio n. 1
0
 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)
Esempio n. 2
0
 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)
Esempio n. 3
0
    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)
Esempio n. 4
0
    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)
Esempio n. 5
0
 def _on_finished(self):
     if not self.timed_out():
         self._set_exit_code(self._proc.wait())
     CommandTask._on_finished(self)
Esempio n. 6
0
 def _on_finished(self):
     if not self.timed_out():
         self._set_exit_code(self._ssh_session.recv_exit_status())
     CommandTask._on_finished(self)
Esempio n. 7
0
 def _on_finished(self):
     if not self.timed_out():
         self._set_exit_code(self._ssh_session.recv_exit_status())
     CommandTask._on_finished(self)
Esempio n. 8
0
 def _on_finished(self):
     if not self.timed_out():
         self._set_exit_code(self._proc.wait())
     CommandTask._on_finished(self)