ansible-collections / community.hashi_vault

Ansible collection for managing and working with HashiCorp Vault.
https://docs.ansible.com/ansible/devel/collections/community/hashi_vault/index.html
GNU General Public License v3.0
81 stars 61 forks source link

retries - `urllib3` fallback import from vendored version in `requests` is not correct #116

Closed briantist closed 3 years ago

briantist commented 3 years ago
SUMMARY

In implementing retries, we need urllib3.util.Retry. We first try to import a standalone version of urllib3, which is usually available.

We have a fallback in case that fails to try to import via the requests library, which has a vendored version of urllib3 as well:

from requests.packages.urllib3.util import Retry

However this is not the correct form; instead we must import urllib3 as a module:

from requests.packages import urllib3

And then use it from there.

See: https://docs.python-requests.org/en/master/community/updates/#id25

No bug reports or issues in the wild have yet come up as a result of this, to my knowledge.

ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS