X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=curlwrapper.py;h=21b499c2d12fd998e8afd5634761adaf6f73a654;hb=08d71ce9b241ecd0ca67f0fb634fc9cfb26405dc;hp=4aa634d76e30be6e8e465900778cdf312ae42883;hpb=ba26952042ff8591b223fdb7413946cd5df91de3;p=nodemanager.git diff --git a/curlwrapper.py b/curlwrapper.py index 4aa634d..21b499c 100644 --- a/curlwrapper.py +++ b/curlwrapper.py @@ -1,11 +1,16 @@ -# $Id$ +# Note +# in spring 2010, an attempt was made to use pycurl instead of forking curl +# it turned out, however, that after around 10 cycles of the nodemanager, +# attempts to call GetSlivers were failing with a curl error 60 +# we are thus reverting to the version from tag curlwrapper.py-NodeManager-2.0-8 +# the (broekn) pycurl version can be found in tags 2.0-9 and 2.0-10 from subprocess import PIPE, Popen from select import select -# raise xmplrpclib.ProtocolError import xmlrpclib import signal import os + import logger class Sopen(Popen): @@ -13,7 +18,8 @@ class Sopen(Popen): os.kill(self.pid, signal) def retrieve(url, cacert=None, postdata=None, timeout=90): - options = ('/usr/bin/curl', '--fail', '--silent') +# options = ('/usr/bin/curl', '--fail', '--silent') + options = ('/usr/bin/curl', '--fail', ) if cacert: options += ('--cacert', cacert) if postdata: options += ('--data', '@-') if timeout: @@ -31,6 +37,7 @@ def retrieve(url, cacert=None, postdata=None, timeout=90): rc = p.wait() if rc != 0: # when this triggers, the error sometimes doesn't get printed + logger.log ("curlwrapper: retrieve, got stderr <%s>"%err) raise xmlrpclib.ProtocolError(url, rc, err, postdata) else: return data