Skip to content

Commit

Permalink
Update comment, add StrictVersion.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Jul 2, 2022
1 parent 7d59496 commit 99c9201
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions plugins/module_utils/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@
__metaclass__ = type


# Once we drop support for Ansible 2.9, ansible-base 2.10, and ansible-core 2.11, we can
# remove the _version.py file, and replace the following import by
#
# from ansible.module_utils.compat.version import LooseVersion
# Once we drop support for ansible-core 2.11, we can remove the try/except.

from ansible.module_utils.six import raise_from

try:
from ansible.module_utils.compat.version import LooseVersion
from ansible.module_utils.compat.version import LooseVersion, StrictVersion
except ImportError:
try:
from distutils.version import LooseVersion
from distutils.version import LooseVersion, StrictVersion
except ImportError as exc:
msg = 'To use this plugin or module with ansible-core 2.11, you need to use Python < 3.12 with distutils.version present'
raise_from(ImportError(msg), exc)

0 comments on commit 99c9201

Please sign in to comment.