From b03084e60ef6d5374bc4d817d72c061c4f883585 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Thu, 26 Aug 2021 17:32:05 +0100 Subject: [PATCH] Use cache from ansible-compat (#65) --- .pre-commit-config.yaml | 1 + setup.cfg | 1 + src/molecule_podman/driver.py | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c3ee041..7b0bac8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,6 +43,7 @@ repos: entry: mypy src/ pass_filenames: false additional_dependencies: + - ansible-compat>=0.5.0 - molecule - packaging - repo: https://github.com/pre-commit/mirrors-pylint diff --git a/setup.cfg b/setup.cfg index 99d3cce..f8a39b2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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-podman modules # and allows us of isolated (default) virtualenvs. It does not avoid need diff --git a/src/molecule_podman/driver.py b/src/molecule_podman/driver.py index 91a4df1..d036421 100644 --- a/src/molecule_podman/driver.py +++ b/src/molecule_podman/driver.py @@ -25,9 +25,9 @@ import os from typing import Dict +from ansible_compat.ports import cache from molecule import logger, util from molecule.api import Driver -from molecule.util import lru_cache log = logger.get_logger(__name__) @@ -198,7 +198,7 @@ def ansible_connection_options(self, instance_name): "ansible_podman_executable": f"{self.podman_exec}", } - @lru_cache() + @cache def sanity_checks(self): """Implement Podman driver sanity checks.""" log.info("Sanity checks: '{}'".format(self._name))