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

Commit 62f1b3c

Browse files
committed
Avoided lru_cache due mypy problems
python/mypy#5107
1 parent a314fc8 commit 62f1b3c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/molecule_docker/driver.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ class Docker(Driver):
183183
.. _`CMD`: https://docs.docker.com/engine/reference/builder/#cmd
184184
""" # noqa
185185

186+
_passed_sanity = False
187+
186188
def __init__(self, config=None):
187189
"""Construct Docker."""
188190
super(Docker, self).__init__(config)
@@ -224,11 +226,12 @@ def ansible_connection_options(self, instance_name):
224226
x["ansible_docker_extra_args"] = f"-H={os.environ['DOCKER_HOST']}"
225227
return x
226228

227-
@cache(maxsize=None)
228229
def sanity_checks(self):
229230
"""Implement Docker driver sanity checks."""
230-
log.info("Sanity checks: '%s'", self._name)
231+
if self._passed_sanity:
232+
return
231233

234+
log.info("Sanity checks: '%s'", self._name)
232235
try:
233236
import docker
234237
import requests
@@ -243,6 +246,8 @@ def sanity_checks(self):
243246
)
244247
sysexit_with_message(msg)
245248

249+
self._passed_sanity = True
250+
246251
def reset(self):
247252
import docker
248253

0 commit comments

Comments
 (0)