Don't use deprecated distutils from python 3.10
distutils is deprecated in 3.10: https://peps.python.org/pep-0632/ Ansible requires it to be replaced[1] [1] https://github.com/ansible-community/community-topics/issues/96 https://github.com/ansible-collections/news-for-maintainers/issues/18 Change-Id: I2bae37f206319e8f9ace468f5b94f6be643b6a3c
This commit is contained in:
parent
0215e2a5d4
commit
ccbbc319ce
@ -29,7 +29,16 @@
|
|||||||
|
|
||||||
import abc
|
import abc
|
||||||
import copy
|
import copy
|
||||||
from distutils.version import StrictVersion
|
from ansible.module_utils.six import raise_from
|
||||||
|
try:
|
||||||
|
from ansible.module_utils.compat.version import StrictVersion
|
||||||
|
except ImportError:
|
||||||
|
try:
|
||||||
|
from distutils.version import StrictVersion
|
||||||
|
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)
|
||||||
import importlib
|
import importlib
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
@ -56,7 +56,16 @@ import collections
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
from distutils.version import StrictVersion
|
from ansible.module_utils.six import raise_from
|
||||||
|
try:
|
||||||
|
from ansible.module_utils.compat.version import StrictVersion
|
||||||
|
except ImportError:
|
||||||
|
try:
|
||||||
|
from distutils.version import StrictVersion
|
||||||
|
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)
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
Loading…
Reference in New Issue
Block a user