- p = Popen((CURL, '--cacert', '/usr/boot/cacert.pem', '--data', '@-', 'https://%s%s' % (host, handler)), stdin=PIPE, stdout=PIPE, stderr=PIPE)
- p.stdin.write(request_body)
- p.stdin.close()
- contents = p.stdout.read()
- p.stdout.close()
- error = p.stderr.read()
- p.stderr.close()
- rc = p.wait()
- if rc != 0: raise xmlrpclib.ProtocolError(host + handler, rc, error, '')
+ url='https://%s%s' % (host, handler)
+ # this might raise an xmlrpclib.Protocolerror exception
+ contents = curlwrapper.retrieve(url,
+ cacert = self.cacert,
+ postdata = request_body,
+ timeout = self.timeout)