Example #1
0
 def run_command(host, command, username=None, port=None):
     cmd, path = command.split(' ')
     cmd = cmd.split('-', 1)
     path = path.replace("'", "")
     p = subprocess.Popen(cmd + [path], bufsize=0, stdin=subprocess.PIPE,
                          stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     return client.SubprocessWrapper(p)
Example #2
0
 def run_command(host, command, username=None, port=None):
     cmd, path = command[0].replace("'", '').split(' ')
     cmd = cmd.split('-', 1)
     p = subprocess.Popen(cmd + [path],
                          env=get_safe_env(),
                          stdin=subprocess.PIPE,
                          stdout=subprocess.PIPE,
                          stderr=subprocess.PIPE)
     return client.SubprocessWrapper(p)