Commit 8c83f2e7 authored by Nicolas Wavrant's avatar Nicolas Wavrant

pbs: open device for output in write mode

As found by jm@nexedi.com :

>>> with open('/dev/null') as f:
...   subprocess.check_call(('echo', 'foo'), stdout=f)

echo: write error: Bad file descriptor
parent 7ddefe29
......@@ -43,7 +43,7 @@ from slapos.recipe.librecipe import shlex
def promise(ssh_client, user, host, port):
# Redirect output to /dev/null
with open(os.devnull) as _dev_null:
with open(os.devnull, 'wb') as _dev_null:
ssh = subprocess.Popen(
(ssh_client, '%s@%s' % (user, host), '-p', str(port)),
stdin=subprocess.PIPE, stdout=_dev_null, universal_newlines=True)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment