support sudo on local popen

Issue #21 on hold
Alfredo Deza
created an issue

To create a gateway over ssh, sudo python works great because it is used as part of a string (note that I am printing the args being passed to Popen):

gw = execnet.makegateway('ssh=node1//python=sudo python')
['ssh', '-C', 'node1', 'sudo python -c "import sys;exec(eval(sys.stdin.readline()))"']

But that is not the case with a local popen gateway:

 gw = execnet.makegateway('popen//python=sudo python')
['sudo python', '-u', '-c', 'import sys;exec(eval(sys.stdin.readline()))']

'sudo python` will make Popen raise an OSError because it can't find the executable.

When using this fix [0] I am able to start a local popen gateway with sudo python

gw = execnet.makegateway('popen//python=sudo python')
['sudo', 'python', '-u', '-c', 'import sys;exec(eval(sys.stdin.readline()))']

Is it possible to consider that change to allow local popen gateways with sudo?


Comments (5)

  1. Log in to comment