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

Commit 44a2ebd

Browse files
committed
Use cache from ansible-compat
Related: ansible/molecule#3180
1 parent 3eca5ba commit 44a2ebd

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ repos:
5151
entry: mypy src/
5252
pass_filenames: false
5353
additional_dependencies:
54+
- ansible-compat>=0.5.0
5455
- molecule
5556
- packaging
5657
- types-requests

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ setup_requires =
6666

6767
# These are required in actual runtime:
6868
install_requires =
69+
ansible-compat >= 0.5.0
6970
molecule >= 3.4.0
7071
# selinux python module is needed as least by ansible-docker modules
7172
# and allows use of isolated (default) virtualenvs. It does not avoid need

src/molecule_docker/driver.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
import os
2525
from typing import Dict
2626

27+
from ansible_compat.ports import cache
2728
from molecule import logger
2829
from molecule.api import Driver
29-
from molecule.util import lru_cache, sysexit_with_message
30+
from molecule.util import sysexit_with_message
3031

3132
log = logger.get_logger(__name__)
3233

@@ -223,7 +224,7 @@ def ansible_connection_options(self, instance_name):
223224
x["ansible_docker_extra_args"] = "-H={}".format(os.environ["DOCKER_HOST"])
224225
return x
225226

226-
@lru_cache()
227+
@cache
227228
def sanity_checks(self):
228229
"""Implement Docker driver sanity checks."""
229230
log.info("Sanity checks: '{}'".format(self._name))

0 commit comments

Comments
 (0)