Prepare for distutils.version being removed in Python 3.12 (#3936) (#3942)

* Prepare for distutils.version being removed in Python 2.12.

* Fix copy'n'paste error.

* Re-add Loose prefix.

* Fix Python version typos.

* Improve formulation.

* Move message into own line.

* Fix casing, now that the object is no longer called Version.

(cherry picked from commit a2f72be6c8)
This commit is contained in:
Felix Fontein 2021-12-24 19:15:51 +01:00 committed by GitHub
parent 73580d09e0
commit e02568d28a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 102 additions and 59 deletions

View file

@ -119,12 +119,13 @@ compose:
import re
from ansible.module_utils.common._collections_compat import MutableMapping
from distutils.version import LooseVersion
from ansible.errors import AnsibleError
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable
from ansible.module_utils.six.moves.urllib.parse import urlencode
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
# 3rd party imports
try:
import requests