oslo.vmware/oslo_vmware
Stephen Finucane e991194cbd Don't use 'requests.PreparedRequest'
We're using 'requests.PreparedRequest' in one place in the tests.
However, the requests docs have a warning that one shouldn't do this:

  Instances are generated from a Request object, and should not be
  instantiated manually; doing so may produce undesirable effects.

It seems we're now seeing just such an effect, as requests has started
attempting to do proxy-related things resulting in the following error:

    Traceback (most recent call last):
      File "/usr/lib64/python3.6/unittest/mock.py", line 1183, in patched
    return func(*args, **keywargs)
      File ".../oslo.vmware/oslo_vmware/tests/test_service.py", line 518, in test_send_with_local_file_url
    resp = transport.session.send(request)
      File ".../oslo.vmware/.tox/py36/lib/python3.6/site-packages/requests/sessions.py", line 636, in send
    kwargs.setdefault('proxies', self.rebuild_proxies(request, self.proxies))
      File ".../oslo.vmware/.tox/py36/lib/python3.6/site-packages/requests/sessions.py", line 301, in rebuild_proxies
    if 'Proxy-Authorization' in headers:
    TypeError: argument of type 'NoneType' is not iterable

Do what we should have done from the beginning and use
'requests.Request.prepare' instead.

[1] https://docs.python-requests.org/en/master/api/#requests.PreparedRequest

Change-Id: I072c64904298cf83cb113e402d85fb62626f39f7
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-09-21 15:41:58 +01:00
..
common Ensure that log message with non-ascii code does not raise exception 2019-05-14 16:18:15 +00:00
hacking Update hacking for Python3 2020-03-30 11:56:00 +00:00
locale Imported Translations from Zanata 2020-10-11 07:51:42 +00:00
objects Update hacking for Python3 2020-03-30 11:56:00 +00:00
tests Don't use 'requests.PreparedRequest' 2021-09-21 15:41:58 +01:00
wsdl Add PBM WSDL for vSphere 7.0 2021-01-25 15:36:23 +08:00
__init__.py Move files out of the namespace package 2015-01-12 13:22:13 -05:00
_i18n.py Update URLs in documents according to document migration 2017-07-13 10:17:21 +08:00
api.py Add moref helper functions 2020-07-09 12:16:32 +02:00
constants.py Move files out of the namespace package 2015-01-12 13:22:13 -05:00
dvs_util.py Add moref helper functions 2020-07-09 12:16:32 +02:00
exceptions.py Update hacking for Python3 2020-03-30 11:56:00 +00:00
image_transfer.py Merge "Drop use of six" 2020-03-21 22:05:59 +00:00
image_util.py Support download of virtual disk in ova container 2016-05-19 22:45:40 -07:00
pbm.py Add moref helper functions 2020-07-09 12:16:32 +02:00
rw_handles.py Ignore already deleted lease 2021-04-26 14:47:52 -04:00
service.py Add backend-independent access to cookiejar 2020-07-14 10:03:41 +02:00
version.py pbr.version.VersionInfo needs package name (oslo.xyz and not oslo_xyz) 2017-02-06 12:49:23 -05:00
vim.py Add operation ID for remote calls 2016-12-20 17:46:49 +02:00
vim_util.py Add serialize_object() helper function 2021-04-16 11:05:02 +02:00