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
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
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
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)
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 = []
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
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
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
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