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

Commit

Permalink
Use cache from ansible-compat
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Aug 26, 2021
1 parent 3eca5ba commit 44a2ebd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ repos:
entry: mypy src/
pass_filenames: false
additional_dependencies:
- ansible-compat>=0.5.0
- molecule
- packaging
- types-requests
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ setup_requires =

# These are required in actual runtime:
install_requires =
ansible-compat >= 0.5.0
molecule >= 3.4.0
# selinux python module is needed as least by ansible-docker modules
# and allows use of isolated (default) virtualenvs. It does not avoid need
Expand Down
5 changes: 3 additions & 2 deletions src/molecule_docker/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
import os
from typing import Dict

from ansible_compat.ports import cache
from molecule import logger
from molecule.api import Driver
from molecule.util import lru_cache, sysexit_with_message
from molecule.util import sysexit_with_message

log = logger.get_logger(__name__)

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

@lru_cache()
@cache
def sanity_checks(self):
"""Implement Docker driver sanity checks."""
log.info("Sanity checks: '{}'".format(self._name))
Expand Down

0 comments on commit 44a2ebd

Please sign in to comment.