mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-03-15 19:58:28 +00:00
Fix imports. (#585)
This commit is contained in:
parent
449b91d489
commit
a426232523
@ -21,9 +21,9 @@ BACKPORTS_SSL_MATCH_HOSTNAME_IMPORT_ERROR = None
|
||||
|
||||
|
||||
try:
|
||||
from requests import Session
|
||||
from requests.adapters import HTTPAdapter
|
||||
from requests.exceptions import HTTPError, InvalidSchema
|
||||
from requests import Session # noqa: F401, pylint: disable=unused-import
|
||||
from requests.adapters import HTTPAdapter # noqa: F401, pylint: disable=unused-import
|
||||
from requests.exceptions import HTTPError, InvalidSchema # noqa: F401, pylint: disable=unused-import
|
||||
except ImportError:
|
||||
REQUESTS_IMPORT_ERROR = traceback.format_exc()
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ except ImportError:
|
||||
|
||||
|
||||
try:
|
||||
from requests.exceptions import RequestException
|
||||
from requests.exceptions import RequestException # noqa: F401, pylint: disable=unused-import
|
||||
except ImportError:
|
||||
# Either Docker SDK for Python is no longer using requests, or Docker SDK for Python isn't around either,
|
||||
# or Docker SDK for Python's dependency requests is missing. In any case, define an exception
|
||||
|
||||
@ -19,7 +19,7 @@ from ansible.module_utils.parsing.convert_bool import BOOLEANS_TRUE, BOOLEANS_FA
|
||||
from ansible_collections.community.docker.plugins.module_utils.version import LooseVersion
|
||||
|
||||
try:
|
||||
from requests.exceptions import RequestException, SSLError
|
||||
from requests.exceptions import RequestException, SSLError # noqa: F401, pylint: disable=unused-import
|
||||
except ImportError:
|
||||
# Define an exception class RequestException so that our code doesn't break.
|
||||
class RequestException(Exception):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user