Request library raises InvalidURL and InvalidSchema for local file URLs

Bug #1371575 reported by Vipin Balachandran
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.vmware
Fix Released
Critical
Vipin Balachandran

Bug Description

Version 1.2.1 doesn't support 'file:' URLs and raises InvalidURL.

File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/oslo/vmware/service.py", line 138, in __init__
    cache=_CACHE)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/suds/client.py", line 112, in __init__
    self.wsdl = reader.open(url)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/suds/reader.py", line 152, in open
    d = self.fn(url, self.options)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/suds/wsdl.py", line 136, in __init__
    d = reader.open(url)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/suds/reader.py", line 79, in open
    d = self.download(url)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/suds/reader.py", line 95, in download
    fp = self.options.transport.open(Request(url))
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/oslo/vmware/service.py", line 85, in open
    resp = self.session.get(request.url, verify=self.verify)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/requests/sessions.py", line 359, in get
    return self.request('GET', url, **kwargs)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/requests/sessions.py", line 336, in request
    prep = req.prepare()
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/requests/models.py", line 222, in prepare
    p.prepare_url(self.url, self.params)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/requests/models.py", line 294, in prepare_url
    raise InvalidURL("Invalid URL %t: No host supplied" % url)

Version 2.1.0 onwards doesn't have this problem. But it fails with InvalidSchema error.

  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/oslo/vmware/pbm.py", line 58, in __init__
    super(Pbm, self).__init__(wsdl_url, soap_url, cacert, insecure)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/oslo/vmware/service.py", line 138, in __init__
    cache=_CACHE)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/suds/client.py", line 112, in __init__
    self.wsdl = reader.open(url)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/suds/reader.py", line 152, in open
    d = self.fn(url, self.options)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/suds/wsdl.py", line 136, in __init__
    d = reader.open(url)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/suds/reader.py", line 79, in open
    d = self.download(url)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/suds/reader.py", line 95, in download
    fp = self.options.transport.open(Request(url))
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/oslo/vmware/service.py", line 85, in open
    resp = self.session.get(request.url, verify=self.verify)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/requests/sessions.py", line 463, in get
    return self.request('GET', url, **kwargs)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/requests/sessions.py", line 451, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/requests/sessions.py", line 551, in send
    adapter = self.get_adapter(url=request.url)
  File "/opt/stack/oslo.vmware/.tox/py27/local/lib/python2.7/site-packages/requests/sessions.py", line 630, in get_adapter
    raise InvalidSchema("No connection adapters were found for '%s'" % url)
InvalidSchema: No connection adapters were found for 'file:///opt/stack/oslo.vmware/oslo/vmware/wsdl/5.5/pbmService.wsdl'

Changed in oslo.vmware:
importance: Undecided → Critical
Revision history for this message
Vipin Balachandran (vbala) wrote :
Changed in oslo.vmware:
status: New → In Progress
Changed in oslo.vmware:
status: In Progress → Fix Committed
Changed in oslo.vmware:
milestone: none → 0.7.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers