X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=curlwrapper.py;h=e2595789ac0304b28203fbe69c5b3c234b150e8d;hb=refs%2Fheads%2F1.5;hp=97a35a3ad332c4f01244667f7bd3dff47b7fb177;hpb=347202d6aab0acc9126767ceaf89df28a29a82ad;p=nodemanager.git diff --git a/curlwrapper.py b/curlwrapper.py index 97a35a3..e259578 100644 --- a/curlwrapper.py +++ b/curlwrapper.py @@ -4,11 +4,11 @@ from subprocess import PIPE, Popen class CurlException(Exception): pass def retrieve(url, cacert=None, postdata=None, timeout=300): - options = ('/usr/bin/curl',) + options = ('/usr/bin/curl', '--fail', '--silent') if cacert: options += ('--cacert', cacert) if postdata: options += ('--data', '@-') if timeout: options += ('--max-time', str(timeout)) - p = Popen(options + (url,), stdin=PIPE, stdout=PIPE, stderr=PIPE) + p = Popen(options + (url,), stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True) if postdata: p.stdin.write(postdata) p.stdin.close() data = p.stdout.read()