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

Commit

Permalink
Expose required collection
Browse files Browse the repository at this point in the history
Use new molecule API to expose required collection and removes
dependency on ansiblelint.prerun module.

Depends-On: ansible/molecule#3192
  • Loading branch information
ssbarnea committed Jul 19, 2021
1 parent 966800d commit 15abc90
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Expand Up @@ -50,7 +50,6 @@ repos:
entry: mypy lib/
pass_filenames: false
additional_dependencies:
- ansible-lint>=5.1.0a0
- molecule
- packaging
- repo: https://github.com/pre-commit/mirrors-pylint
Expand All @@ -59,7 +58,6 @@ repos:
- id: pylint
additional_dependencies:
- ansible-core>=2.11.1
- ansible-lint>=5.1.0a0
- molecule
- repo: https://github.com/ansible/ansible-lint.git
rev: v5.1.0a0
Expand Down
8 changes: 6 additions & 2 deletions lib/molecule_podman/driver.py
Expand Up @@ -22,8 +22,8 @@
from __future__ import absolute_import

import os
from typing import Dict

from ansiblelint.prerun import require_collection
from molecule import logger
from molecule.api import Driver
from molecule.util import lru_cache
Expand Down Expand Up @@ -190,4 +190,8 @@ def ansible_connection_options(self, instance_name):
def sanity_checks(self):
"""Implement Podman driver sanity checks."""
log.info("Sanity checks: '{}'".format(self._name))
require_collection("containers.podman", "1.6.1")

@property
def required_collections(self) -> Dict[str, str]:
"""Return collections dict containing names and versions required."""
return {"containers.podman": "1.6.1"}
2 changes: 0 additions & 2 deletions setup.cfg
Expand Up @@ -66,8 +66,6 @@ setup_requires =

# These are required in actual runtime:
install_requires =
# we need require_collection from ansiblelint.prerun
ansible-lint >= 5.1.0a0
molecule >= 3.2.0
# selinux python module is needed as least by ansible-podman modules
# and allows us of isolated (default) virtualenvs. It does not avoid need
Expand Down

0 comments on commit 15abc90

Please sign in to comment.