Guest User

Untitled

a guest
Apr 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. result = remote_command_runner_util.CommandRunner(command, host, user).execute()
  2.  
  3. import pipes, shlex
  4. if hasattr(pipes, 'quote'):
  5. quote = pipes.quote # Python 2
  6. else:
  7. quote = shlex.quote # Python 3
  8.  
  9. def executeCommand(argv, host, user):
  10. cmd_str = (' '.join(quote(arg) for arg in argv))
  11. return remote_command_runner_util.CommandRunner(cmd_str, host, user).execute()
  12.  
  13. executeCommand(['java', '-jar', '/path/to/remote.jar', 'com.test.helloWorld'], host, user)
Add Comment
Please, Sign In to add comment