mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 02:41:25 -07:00
Prepare for distutils.version being removed in Python 3.12 (#3936)
* 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.
This commit is contained in:
parent
f34c454412
commit
a2f72be6c8
41 changed files with 106 additions and 63 deletions
|
@ -7,11 +7,11 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
from distutils.version import StrictVersion
|
||||
|
||||
from ansible.module_utils.basic import missing_required_lib
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
|
||||
|
||||
try:
|
||||
from urllib import quote_plus # Python 2.X
|
||||
from urlparse import urljoin
|
||||
|
@ -79,7 +79,7 @@ def gitlab_authentication(module):
|
|||
# python-gitlab library remove support for username/password authentication since 1.13.0
|
||||
# Changelog : https://github.com/python-gitlab/python-gitlab/releases/tag/v1.13.0
|
||||
# This condition allow to still support older version of the python-gitlab library
|
||||
if StrictVersion(gitlab.__version__) < StrictVersion("1.13.0"):
|
||||
if LooseVersion(gitlab.__version__) < LooseVersion("1.13.0"):
|
||||
gitlab_instance = gitlab.Gitlab(url=gitlab_url, ssl_verify=validate_certs, email=gitlab_user, password=gitlab_password,
|
||||
private_token=gitlab_token, api_version=4)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue