mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Make CI pass; add black and isort to CI; add reformat commit to .git-blame-ignore-revs.
This commit is contained in:
@@ -43,9 +43,9 @@ except ImportError:
|
||||
|
||||
try:
|
||||
from requests.packages import urllib3 # pylint: disable=unused-import
|
||||
from requests.packages.urllib3 import (
|
||||
connection as urllib3_connection, # pylint: disable=unused-import
|
||||
)
|
||||
|
||||
# pylint: disable-next=unused-import
|
||||
from requests.packages.urllib3 import connection as urllib3_connection
|
||||
except ImportError:
|
||||
try:
|
||||
import urllib3 # pylint: disable=unused-import
|
||||
|
||||
@@ -231,7 +231,7 @@ class APIClient(_Session, DaemonApiMixin):
|
||||
return version_result["ApiVersion"]
|
||||
except KeyError:
|
||||
raise DockerException(
|
||||
'Invalid response from docker daemon: key "ApiVersion"' " is missing."
|
||||
'Invalid response from docker daemon: key "ApiVersion" is missing.'
|
||||
)
|
||||
except Exception as e:
|
||||
raise DockerException(
|
||||
|
||||
@@ -68,7 +68,7 @@ class TLSConfig(object):
|
||||
tls_cert, tls_key = client_cert
|
||||
except ValueError:
|
||||
raise errors.TLSParameterError(
|
||||
"client_cert must be a tuple of" " (client certificate, key file)"
|
||||
"client_cert must be a tuple of (client certificate, key file)"
|
||||
)
|
||||
|
||||
if not (tls_cert and tls_key) or (
|
||||
|
||||
@@ -59,7 +59,7 @@ class NpipeHTTPConnectionPool(urllib3.connectionpool.HTTPConnectionPool):
|
||||
if self.block:
|
||||
raise urllib3.exceptions.EmptyPoolError(
|
||||
self,
|
||||
"Pool reached maximum size and no more " "connections are allowed.",
|
||||
"Pool reached maximum size and no more connections are allowed.",
|
||||
)
|
||||
pass # Oh well, we'll create a new connection then
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ class SSHSocket(socket.socket):
|
||||
def _write(self, data):
|
||||
if not self.proc or self.proc.stdin.closed:
|
||||
raise Exception(
|
||||
"SSH subprocess not initiated." "connect() must be called first."
|
||||
"SSH subprocess not initiated. connect() must be called first."
|
||||
)
|
||||
written = self.proc.stdin.write(data)
|
||||
self.proc.stdin.flush()
|
||||
@@ -96,7 +96,7 @@ class SSHSocket(socket.socket):
|
||||
def recv(self, n):
|
||||
if not self.proc:
|
||||
raise Exception(
|
||||
"SSH subprocess not initiated." "connect() must be called first."
|
||||
"SSH subprocess not initiated. connect() must be called first."
|
||||
)
|
||||
return self.proc.stdout.read(n)
|
||||
|
||||
@@ -166,7 +166,7 @@ class SSHConnectionPool(urllib3.connectionpool.HTTPConnectionPool):
|
||||
if self.block:
|
||||
raise urllib3.exceptions.EmptyPoolError(
|
||||
self,
|
||||
"Pool reached maximum size and no more " "connections are allowed.",
|
||||
"Pool reached maximum size and no more connections are allowed.",
|
||||
)
|
||||
pass # Oh well, we'll create a new connection then
|
||||
|
||||
|
||||
@@ -80,6 +80,7 @@ except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
# pylint: disable=unused-import
|
||||
from ansible_collections.community.docker.plugins.module_utils.util import (
|
||||
BYTE_SUFFIXES, # TODO: remove
|
||||
)
|
||||
@@ -122,7 +123,7 @@ from ansible_collections.community.docker.plugins.module_utils.util import (
|
||||
from ansible_collections.community.docker.plugins.module_utils.util import (
|
||||
parse_healthcheck, # TODO: remove
|
||||
)
|
||||
from ansible_collections.community.docker.plugins.module_utils.util import ( # noqa: F401, pylint: disable=unused-import
|
||||
from ansible_collections.community.docker.plugins.module_utils.util import ( # noqa: F401
|
||||
DEFAULT_DOCKER_HOST,
|
||||
DEFAULT_TIMEOUT_SECONDS,
|
||||
DEFAULT_TLS,
|
||||
@@ -135,6 +136,9 @@ from ansible_collections.community.docker.plugins.module_utils.util import ( #
|
||||
)
|
||||
|
||||
|
||||
# pylint: enable=unused-import
|
||||
|
||||
|
||||
MIN_DOCKER_VERSION = "1.8.0"
|
||||
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ from ansible_collections.community.docker.plugins.module_utils._api.utils.utils
|
||||
convert_filters,
|
||||
parse_repository_tag,
|
||||
)
|
||||
|
||||
# pylint: disable=unused-import
|
||||
from ansible_collections.community.docker.plugins.module_utils.util import (
|
||||
DEFAULT_DOCKER_REGISTRY, # TODO: remove
|
||||
)
|
||||
@@ -55,7 +57,7 @@ from ansible_collections.community.docker.plugins.module_utils.util import (
|
||||
from ansible_collections.community.docker.plugins.module_utils.util import (
|
||||
is_valid_tag, # TODO: remove
|
||||
)
|
||||
from ansible_collections.community.docker.plugins.module_utils.util import ( # noqa: F401, pylint: disable=unused-import
|
||||
from ansible_collections.community.docker.plugins.module_utils.util import ( # noqa: F401
|
||||
DEFAULT_DOCKER_HOST,
|
||||
DEFAULT_TIMEOUT_SECONDS,
|
||||
DEFAULT_TLS,
|
||||
@@ -68,6 +70,9 @@ from ansible_collections.community.docker.plugins.module_utils.util import ( #
|
||||
)
|
||||
|
||||
|
||||
# pylint: enable=unused-import
|
||||
|
||||
|
||||
def _get_tls_config(fail_function, **kwargs):
|
||||
try:
|
||||
tls_config = TLSConfig(**kwargs)
|
||||
|
||||
@@ -214,9 +214,7 @@ _RE_WARNING_EVENT = re.compile(
|
||||
r"$" % "|".join(re.escape(status) for status in DOCKER_STATUS_WARNING)
|
||||
)
|
||||
|
||||
_RE_CONTINUE_EVENT = re.compile(
|
||||
r"^" r"\s*" r"(?P<resource_id>\S+)" r"\s+" r"-" r"\s*" r"(?P<msg>\S(?:|.*\S))" r"$"
|
||||
)
|
||||
_RE_CONTINUE_EVENT = re.compile(r"^\s*(?P<resource_id>\S+)\s+-\s*(?P<msg>\S(?:|.*\S))$")
|
||||
|
||||
_RE_SKIPPED_EVENT = re.compile(
|
||||
r"^"
|
||||
@@ -229,11 +227,9 @@ _RE_SKIPPED_EVENT = re.compile(
|
||||
r"$"
|
||||
)
|
||||
|
||||
_RE_BUILD_START_EVENT = re.compile(
|
||||
r"^" r"\s*" r"build service" r"\s+" r"(?P<resource_id>\S+)" r"$"
|
||||
)
|
||||
_RE_BUILD_START_EVENT = re.compile(r"^\s*build service\s+(?P<resource_id>\S+)$")
|
||||
|
||||
_RE_BUILD_PROGRESS_EVENT = re.compile(r"^" r"\s*" r"==>" r"\s+" r"(?P<msg>.*)" r"$")
|
||||
_RE_BUILD_PROGRESS_EVENT = re.compile(r"^\s*==>\s+(?P<msg>.*)$")
|
||||
|
||||
# The following needs to be kept in sync with the MINIMUM_VERSION compose_v2 docs fragment
|
||||
MINIMUM_COMPOSE_VERSION = "2.18.0"
|
||||
|
||||
Reference in New Issue
Block a user