示例#1
0
 def __init__(self, qrouter, host, port):
     super(NeutronHttpAdapter, self).__init__()
     command = 'ip netns exec qrouter-{0} nc {1} {2}'.format(qrouter,
                                                             host, port)
     LOG.debug('Neutron adapter created with cmd {0}'.format(command))
     self.cmd = shlsplit(command)
     self.port = port
     self.host = host
示例#2
0
 def __init__(self, qrouter, host, port):
     super(NeutronHttpAdapter, self).__init__()
     command = 'ip netns exec qrouter-{0} nc {1} {2}'.format(
         qrouter, host, port)
     LOG.debug('Neutron adapter created with cmd {0}'.format(command))
     self.cmd = shlsplit(command)
     self.port = port
     self.host = host
示例#3
0
    def __init__(self, command_line):  # pylint: disable=super-init-not-called
        # Note that the super().__init__ MUST NOT be called here, otherwise
        # two subprocesses will be created.
        import os
        from subprocess import Popen, PIPE
        from shlex import split as shlsplit

        self.cmd = shlsplit(command_line)
        self.process = Popen(self.cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, bufsize=0, preexec_fn=os.setsid)  # pylint: disable=subprocess-popen-preexec-fn
        self.timeout = None
示例#4
0
    def __init__(self, command_line):
        """
        Create a new CommandProxy instance. The instance created by this
        class can be passed as an argument to the L{Transport} class.

        @param command_line: the command that should be executed and
            used as the proxy.
        @type command_line: str
        """
        self.cmd = shlsplit(command_line)
        self.process = Popen(self.cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
示例#5
0
    def __init__(self, command_line):
        """
        Create a new CommandProxy instance. The instance created by this
        class can be passed as an argument to the L{Transport} class.

        @param command_line: the command that should be executed and
            used as the proxy.
        @type command_line: str
        """
        self.cmd = shlsplit(command_line)
        self.process = Popen(self.cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
示例#6
0
    def __init__(self, command_line):
        """
        Create a new CommandProxy instance. The instance created by this
        class can be passed as an argument to the `.Transport` class.

        :param str command_line:
            the command that should be executed and used as the proxy.
        """
        self.cmd = shlsplit(command_line)
        self.process = Popen(self.cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
        self.timeout = None
        self.buffer = []
示例#7
0
    def __init__(self, command_line):
        """
        Create a new CommandProxy instance. The instance created by this
        class can be passed as an argument to the `.Transport` class.

        :param str command_line:
            the command that should be executed and used as the proxy.
        """
        self.cmd = shlsplit(command_line)
        self.process = Popen(self.cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
        self.timeout = None
        self.buffer = []
示例#8
0
    def __init__(self, command_line):  # pylint: disable=super-init-not-called
        # Note that the super().__init__ MUST NOT be called here, otherwise two subprocesses will be created.
        from subprocess import Popen, PIPE
        from shlex import split as shlsplit

        self.cmd = shlsplit(command_line)
        self.process = Popen(self.cmd,
                             stdin=PIPE,
                             stdout=PIPE,
                             stderr=PIPE,
                             bufsize=0,
                             start_new_session=True)
        self.timeout = None
示例#9
0
    def __init__(self, command_line):
        import os
        from subprocess import Popen, PIPE
        from shlex import split as shlsplit
        super(_DetachedProxyCommand, self).__init__(command_line)

        self.cmd = shlsplit(command_line)
        self.process = Popen(self.cmd,
                             stdin=PIPE,
                             stdout=PIPE,
                             stderr=PIPE,
                             bufsize=0,
                             preexec_fn=os.setsid)
        self.timeout = None
示例#10
0
    def __init__(self, command_line):
        """
        Create a new CommandProxy instance. The instance created by this
        class can be passed as an argument to the `.Transport` class.

        :param str command_line:
            the command that should be executed and used as the proxy.
        """
        # NOTE: subprocess import done lazily so platforms without it (e.g.
        # GAE) can still import us during overall Paramiko load.
        from subprocess import Popen, PIPE
        self.cmd = shlsplit(command_line)
        self.process = Popen(self.cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE,
                             bufsize=0)
        self.timeout = None
示例#11
0
    def __init__(self, command_line):
        """
        Create a new CommandProxy instance. The instance created by this
        class can be passed as an argument to the `.Transport` class.

        :param str command_line:
            the command that should be executed and used as the proxy.
        """
        # NOTE: subprocess import done lazily so platforms without it (e.g.
        # GAE) can still import us during overall Paramiko load.
        from subprocess import Popen, PIPE

        self.cmd = shlsplit(command_line)
        self.process = Popen(
            self.cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, bufsize=0
        )
        self.timeout = None