mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-03-30 16:53:57 +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:
|
try:
|
||||||
from requests import Session
|
from requests import Session # noqa: F401, pylint: disable=unused-import
|
||||||
from requests.adapters import HTTPAdapter
|
from requests.adapters import HTTPAdapter # noqa: F401, pylint: disable=unused-import
|
||||||
from requests.exceptions import HTTPError, InvalidSchema
|
from requests.exceptions import HTTPError, InvalidSchema # noqa: F401, pylint: disable=unused-import
|
||||||
except ImportError:
|
except ImportError:
|
||||||
REQUESTS_IMPORT_ERROR = traceback.format_exc()
|
REQUESTS_IMPORT_ERROR = traceback.format_exc()
|
||||||
|
|
||||||
|
|||||||
@ -67,7 +67,7 @@ except ImportError:
|
|||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from requests.exceptions import RequestException
|
from requests.exceptions import RequestException # noqa: F401, pylint: disable=unused-import
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# Either Docker SDK for Python is no longer using requests, or Docker SDK for Python isn't around either,
|
# 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
|
# 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
|
from ansible_collections.community.docker.plugins.module_utils.version import LooseVersion
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from requests.exceptions import RequestException, SSLError
|
from requests.exceptions import RequestException, SSLError # noqa: F401, pylint: disable=unused-import
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# Define an exception class RequestException so that our code doesn't break.
|
# Define an exception class RequestException so that our code doesn't break.
|
||||||
class RequestException(Exception):
|
class RequestException(Exception):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user