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

Commit 1fe384b

Browse files
authored
Fix pylint errors (#131)
Related: pylint-dev/pylint#6535
1 parent 56079a7 commit 1fe384b

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.pre-commit-config.yaml

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ exclude: |
77
(?x)(
88
^docs/conf.py$
99
)
10+
default_language_version:
11+
# make linting predictable, especially as we know that current pylint is not
12+
# working well with py311.
13+
python: python3.8
1014
repos:
1115
- repo: https://github.com/PyCQA/isort
1216
rev: 5.10.1
@@ -50,11 +54,12 @@ repos:
5054
- ansible-compat>=2.2.0
5155
- molecule>=4.0.0
5256
- packaging
53-
- repo: https://github.com/pre-commit/mirrors-pylint
54-
rev: v3.0.0a5
57+
- repo: https://github.com/pycqa/pylint
58+
rev: v2.14.5
5559
hooks:
5660
- id: pylint
5761
additional_dependencies:
62+
# - astroid<=v2.11.6 #
5863
- ansible-core>=2.13
5964
- molecule>=4.0.0
6065
- repo: https://github.com/ansible/ansible-lint.git

src/molecule_podman/driver.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from shutil import which
2727
from typing import Dict
2828

29-
from ansible_compat.ports import cache
3029
from ansible_compat.runtime import Runtime
3130
from molecule import logger, util
3231
from molecule.api import Driver, MoleculeRuntimeWarning
@@ -167,6 +166,7 @@ def __init__(self, config=None):
167166
# An example could be MOLECULE_PODMAN_EXECUTABLE=podman-remote
168167
self.podman_exec = os.environ.get("MOLECULE_PODMAN_EXECUTABLE", "podman")
169168
self._podman_cmd = None
169+
self._sanity_passed = False
170170

171171
@property
172172
def podman_cmd(self):
@@ -214,9 +214,11 @@ def ansible_connection_options(self, instance_name):
214214
"ansible_podman_executable": f"{self.podman_exec}",
215215
}
216216

217-
@cache
218217
def sanity_checks(self):
219218
"""Implement Podman driver sanity checks."""
219+
if self._sanity_passed:
220+
return
221+
220222
log.info("Sanity checks: '%s'", self._name)
221223
# TODO(ssbarnea): reuse ansible runtime instance from molecule once it
222224
# fully adopts ansible-compat
@@ -237,6 +239,7 @@ def sanity_checks(self):
237239
"Do not raise any bugs if your tests are failing with current configuration.",
238240
category=MoleculeRuntimeWarning,
239241
)
242+
self._sanity_passed = True
240243

241244
@property
242245
def required_collections(self) -> Dict[str, str]:

0 commit comments

Comments
 (0)