예제 #1
0
파일: local.py 프로젝트: coder46/rcontrol
 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)
예제 #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)
예제 #3
0
파일: ssh.py 프로젝트: coder46/rcontrol
    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)
예제 #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)
예제 #5
0
파일: local.py 프로젝트: coder46/rcontrol
 def _on_finished(self):
     if not self.timed_out():
         self._set_exit_code(self._proc.wait())
     CommandTask._on_finished(self)
예제 #6
0
파일: ssh.py 프로젝트: coder46/rcontrol
 def _on_finished(self):
     if not self.timed_out():
         self._set_exit_code(self._ssh_session.recv_exit_status())
     CommandTask._on_finished(self)
예제 #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)
예제 #8
0
 def _on_finished(self):
     if not self.timed_out():
         self._set_exit_code(self._proc.wait())
     CommandTask._on_finished(self)