mirror of https://github.com/docker/compose.git
Merge pull request #6296 from docker/flake8-update
Fix new flake8 errors/warnings
This commit is contained in:
commit
2f5d5fc93f
|
@ -54,7 +54,7 @@ def handle_connection_errors(client):
|
||||||
except APIError as e:
|
except APIError as e:
|
||||||
log_api_error(e, client.api_version)
|
log_api_error(e, client.api_version)
|
||||||
raise ConnectionError()
|
raise ConnectionError()
|
||||||
except (ReadTimeout, socket.timeout) as e:
|
except (ReadTimeout, socket.timeout):
|
||||||
log_timeout_error(client.timeout)
|
log_timeout_error(client.timeout)
|
||||||
raise ConnectionError()
|
raise ConnectionError()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
@ -125,7 +125,7 @@ def parse_extra_hosts(extra_hosts_config):
|
||||||
|
|
||||||
|
|
||||||
def normalize_path_for_engine(path):
|
def normalize_path_for_engine(path):
|
||||||
"""Windows paths, c:\my\path\shiny, need to be changed to be compatible with
|
"""Windows paths, c:\\my\\path\\shiny, need to be changed to be compatible with
|
||||||
the Engine. Volume paths are expected to be linux style /c/my/path/shiny/
|
the Engine. Volume paths are expected to be linux style /c/my/path/shiny/
|
||||||
"""
|
"""
|
||||||
drive, tail = splitdrive(path)
|
drive, tail = splitdrive(path)
|
||||||
|
|
|
@ -41,15 +41,15 @@ DOCKER_CONFIG_HINTS = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VALID_NAME_CHARS = '[a-zA-Z0-9\._\-]'
|
VALID_NAME_CHARS = r'[a-zA-Z0-9\._\-]'
|
||||||
VALID_EXPOSE_FORMAT = r'^\d+(\-\d+)?(\/[a-zA-Z]+)?$'
|
VALID_EXPOSE_FORMAT = r'^\d+(\-\d+)?(\/[a-zA-Z]+)?$'
|
||||||
|
|
||||||
VALID_IPV4_SEG = r'(\d{1,2}|1\d{2}|2[0-4]\d|25[0-5])'
|
VALID_IPV4_SEG = r'(\d{1,2}|1\d{2}|2[0-4]\d|25[0-5])'
|
||||||
VALID_IPV4_ADDR = "({IPV4_SEG}\.){{3}}{IPV4_SEG}".format(IPV4_SEG=VALID_IPV4_SEG)
|
VALID_IPV4_ADDR = r"({IPV4_SEG}\.){{3}}{IPV4_SEG}".format(IPV4_SEG=VALID_IPV4_SEG)
|
||||||
VALID_REGEX_IPV4_CIDR = "^{IPV4_ADDR}/(\d|[1-2]\d|3[0-2])$".format(IPV4_ADDR=VALID_IPV4_ADDR)
|
VALID_REGEX_IPV4_CIDR = r"^{IPV4_ADDR}/(\d|[1-2]\d|3[0-2])$".format(IPV4_ADDR=VALID_IPV4_ADDR)
|
||||||
|
|
||||||
VALID_IPV6_SEG = r'[0-9a-fA-F]{1,4}'
|
VALID_IPV6_SEG = r'[0-9a-fA-F]{1,4}'
|
||||||
VALID_REGEX_IPV6_CIDR = "".join("""
|
VALID_REGEX_IPV6_CIDR = "".join(r"""
|
||||||
^
|
^
|
||||||
(
|
(
|
||||||
(({IPV6_SEG}:){{7}}{IPV6_SEG})|
|
(({IPV6_SEG}:){{7}}{IPV6_SEG})|
|
||||||
|
|
|
@ -2361,7 +2361,7 @@ class CLITestCase(DockerClientTestCase):
|
||||||
self.dispatch(['up', '-d'])
|
self.dispatch(['up', '-d'])
|
||||||
|
|
||||||
result = self.dispatch(['logs', '-f', '-t'])
|
result = self.dispatch(['logs', '-f', '-t'])
|
||||||
assert re.search('(\d{4})-(\d{2})-(\d{2})T(\d{2})\:(\d{2})\:(\d{2})', result.stdout)
|
assert re.search(r'(\d{4})-(\d{2})-(\d{2})T(\d{2})\:(\d{2})\:(\d{2})', result.stdout)
|
||||||
|
|
||||||
def test_logs_tail(self):
|
def test_logs_tail(self):
|
||||||
self.base_dir = 'tests/fixtures/logs-tail-composefile'
|
self.base_dir = 'tests/fixtures/logs-tail-composefile'
|
||||||
|
|
Loading…
Reference in New Issue