graphyte: ssh link: better support of SHELL commands

On windows, if we'd like to execute shell commands (might contain
redirecting IOs, assigning environment variables etc), the pipes.quote
does not work for windows default shell.

To make it work on windows, we don't use the "shell=True" argument, but
split the shell command into tokens and call SSH by argument list.

That is, if we'd like to execute 'VAR=X cmd arg0 arg1 >f 2>g'.
We used to do subprocess call by:
  call('ssh <SSH OPTIONS> <pipes.quote('VAR=X cmd arg0 arg1 >f 2>g')>',
       shell=True)
Now we do:
  call(['ssh', <SSH OPTIONS>..., 'VAR=X', 'cmd', 'arg0', 'arg1', ...])

BUG=None
TEST=manual

Change-Id: Id045133ca41629fcf5ba8860882957ab7955a7a9
1 file changed
OSZAR »