Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit cfa2a75

Browse files
[pre-commit.ci] pre-commit autoupdate (#142)
* [pre-commit.ci] pre-commit autoupdate updates: - https://github.com/pre-commit/mirrors-isorthttps://github.com/PyCQA/isort - [github.com/PyCQA/isort: v5.9.3 → 5.9.3](PyCQA/isort@v5.9.3...5.9.3) - https://github.com/python/black.githttps://github.com/psf/black - [github.com/psf/black: 21.7b0 → 21.9b0](psf/black@21.7b0...21.9b0) - https://gitlab.com/pycqa/flake8.githttps://github.com/PyCQA/flake8 - [github.com/PyCQA/flake8: 3.9.2 → 4.0.1](PyCQA/flake8@3.9.2...4.0.1) - [github.com/ansible/ansible-lint.git: v5.1.2 → v5.2.0](https://github.com/ansible/ansible-lint.git/compare/v5.1.2...v5.2.0) - [github.com/pre-commit/mirrors-mypy: v0.910 → v0.910-1](pre-commit/mirrors-mypy@v0.910...v0.910-1) - [github.com/PyCQA/pylint: v2.10.2 → v2.11.1](pylint-dev/pylint@v2.10.2...v2.11.1) * Linting fixes * Avoided lru_cache due mypy problems python/mypy#5107 Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sorin Sbarnea <[email protected]>
1 parent f4efce3 commit cfa2a75

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

.pre-commit-config.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ repos:
1717
hooks:
1818
- id: isort
1919
- repo: https://github.com/psf/black
20-
rev: 22.3.0
20+
rev: 22.6.0
2121
hooks:
2222
- id: black
2323
language_version: python3
2424
- repo: https://github.com/pre-commit/pre-commit-hooks.git
25-
rev: v4.2.0
25+
rev: v4.3.0
2626
hooks:
2727
- id: end-of-file-fixer
2828
- id: trailing-whitespace
@@ -41,8 +41,8 @@ repos:
4141
- flake8-absolute-import>=1.0
4242
- flake8-docstrings>=1.6.0
4343
language_version: python3
44-
- repo: https://github.com/ansible-community/ansible-lint.git
45-
rev: v6.0.2
44+
- repo: https://github.com/ansible/ansible-lint.git
45+
rev: v6.3.0
4646
hooks:
4747
- id: ansible-lint
4848
always_run: true
@@ -52,7 +52,7 @@ repos:
5252
- ansible-core>=2.11
5353
- yamllint
5454
- repo: https://github.com/pre-commit/mirrors-mypy
55-
rev: v0.942
55+
rev: v0.961
5656
hooks:
5757
- id: mypy
5858
# empty args needed in order to match mypy cli behavior
@@ -65,7 +65,7 @@ repos:
6565
- packaging
6666
- types-requests
6767
- repo: https://github.com/PyCQA/pylint
68-
rev: v2.13.5
68+
rev: v2.14.4
6969
hooks:
7070
- id: pylint
7171
additional_dependencies:

.pylintrc

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ disable =
44
# TODO(ssbarnea): remove temporary skips adding during initial adoption:
55
abstract-method,
66
arguments-differ,
7-
bad-continuation,
87
broad-except,
98
consider-merging-isinstance,
109
consider-using-in,

src/molecule_docker/driver.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import os
2525
from typing import Dict
2626

27-
from ansible_compat.ports import cache
2827
from molecule import logger
2928
from molecule.api import Driver
3029
from molecule.util import sysexit_with_message
@@ -183,6 +182,8 @@ class Docker(Driver):
183182
.. _`CMD`: https://docs.docker.com/engine/reference/builder/#cmd
184183
""" # noqa
185184

185+
_passed_sanity = False
186+
186187
def __init__(self, config=None):
187188
"""Construct Docker."""
188189
super(Docker, self).__init__(config)
@@ -224,11 +225,12 @@ def ansible_connection_options(self, instance_name):
224225
x["ansible_docker_extra_args"] = f"-H={os.environ['DOCKER_HOST']}"
225226
return x
226227

227-
@cache
228228
def sanity_checks(self):
229229
"""Implement Docker driver sanity checks."""
230-
log.info("Sanity checks: '%s'", self._name)
230+
if self._passed_sanity:
231+
return
231232

233+
log.info("Sanity checks: '%s'", self._name)
232234
try:
233235
import docker
234236
import requests
@@ -243,6 +245,8 @@ def sanity_checks(self):
243245
)
244246
sysexit_with_message(msg)
245247

248+
self._passed_sanity = True
249+
246250
def reset(self):
247251
import docker
248252

0 commit comments

Comments
 (0)