diff --git a/.pylintrc b/.pylintrc index de472e01..88dd3f68 100644 --- a/.pylintrc +++ b/.pylintrc @@ -381,7 +381,6 @@ disable=raw-checker-failed, # To clean up: abstract-method, arguments-differ, - consider-using-f-string, consider-using-in, consider-using-max-builtin, consider-using-with, diff --git a/plugins/module_utils/_compose_v2.py b/plugins/module_utils/_compose_v2.py index e52b0a16..ab662d4e 100644 --- a/plugins/module_utils/_compose_v2.py +++ b/plugins/module_utils/_compose_v2.py @@ -176,9 +176,9 @@ _RE_PULL_EVENT = re.compile( r"\s*" r"(?P\S+)" r"\s+" - r"(?P%s)" + rf"(?P{'|'.join(re.escape(status) for status in DOCKER_STATUS_PULL)})" r"\s*" - r"$" % "|".join(re.escape(status) for status in DOCKER_STATUS_PULL) + r"$" ) _RE_PULL_PROGRESS = re.compile( @@ -186,14 +186,13 @@ _RE_PULL_PROGRESS = re.compile( r"\s*" r"(?P\S+)" r"\s+" - r"(?P%s)" + rf"(?P{'|'.join( + re.escape(status) + for status in sorted(DOCKER_PULL_PROGRESS_DONE | DOCKER_PULL_PROGRESS_WORKING) + )})" r"\s*" r"(?:|\s\[[^]]+\]\s+\S+\s*|\s+[0-9.kKmMgGbB]+/[0-9.kKmMgGbB]+\s*)" r"$" - % "|".join( - re.escape(status) - for status in sorted(DOCKER_PULL_PROGRESS_DONE | DOCKER_PULL_PROGRESS_WORKING) - ) ) _RE_ERROR_EVENT = re.compile( @@ -201,10 +200,10 @@ _RE_ERROR_EVENT = re.compile( r"\s*" r"(?P\S+)" r"\s+" - r"(?P%s)" + rf"(?P{'|'.join(re.escape(status) for status in DOCKER_STATUS_ERROR)})" r"\s*" r"(?P\S.*\S)?" - r"$" % "|".join(re.escape(status) for status in DOCKER_STATUS_ERROR) + r"$" ) _RE_WARNING_EVENT = re.compile( @@ -212,10 +211,10 @@ _RE_WARNING_EVENT = re.compile( r"\s*" r"(?P\S+)" r"\s+" - r"(?P%s)" + rf"(?P{'|'.join(re.escape(status) for status in DOCKER_STATUS_WARNING)})" r"\s*" r"(?P\S.*\S)?" - r"$" % "|".join(re.escape(status) for status in DOCKER_STATUS_WARNING) + r"$" ) _RE_CONTINUE_EVENT = re.compile(r"^\s*(?P\S+)\s+-\s*(?P\S(?:|.*\S))$")