mirror of
https://github.com/containers/ansible-podman-collections.git
synced 2026-02-04 07:11:49 +00:00
Remove distutils as deprecated (#437)
Fix #422 The distutils package is deprecated and slated for removal in Python 3.12 Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
This commit is contained in:
parent
1003e966ee
commit
2577f5b0f5
6 changed files with 20 additions and 9 deletions
|
|
@ -9,6 +9,17 @@ import os
|
|||
import shutil
|
||||
import signal
|
||||
|
||||
from ansible.module_utils.six import raise_from
|
||||
try:
|
||||
from ansible.module_utils.compat.version import LooseVersion # noqa: F401
|
||||
except ImportError:
|
||||
try:
|
||||
from distutils.version import LooseVersion # noqa: F401
|
||||
except ImportError as exc:
|
||||
raise_from(ImportError('To use this plugin or module with ansible-core'
|
||||
' < 2.11, you need to use Python < 3.12 with '
|
||||
'distutils.version present'), exc)
|
||||
|
||||
|
||||
def run_podman_command(module, executable='podman', args=None, expected_rc=0, ignore_errors=False):
|
||||
if not isinstance(executable, list):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue