mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-04 07:19:10 -07:00
* 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
)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
cd1a92d417
commit
9b57221d9a
41 changed files with 106 additions and 63 deletions
|
@ -158,11 +158,12 @@ diversion:
|
|||
|
||||
import re
|
||||
import os
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.common.text.converters import to_bytes, to_native
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
|
||||
|
||||
|
||||
def diversion_state(module, command, path):
|
||||
diversion = dict(path=path, state='absent', divert=None, holder=None)
|
||||
|
|
|
@ -115,7 +115,6 @@ EXAMPLES = '''
|
|||
fstype: vfat
|
||||
'''
|
||||
|
||||
from distutils.version import LooseVersion
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
|
@ -124,6 +123,8 @@ import stat
|
|||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
|
||||
|
||||
|
||||
class Device(object):
|
||||
def __init__(self, module, path):
|
||||
|
|
|
@ -56,13 +56,14 @@ pids:
|
|||
|
||||
import abc
|
||||
import re
|
||||
from distutils.version import LooseVersion
|
||||
from os.path import basename
|
||||
|
||||
from ansible.module_utils import six
|
||||
from ansible.module_utils.basic import AnsibleModule, 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:
|
||||
import psutil
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ import operator
|
|||
HAS_DISTUTILS = False
|
||||
try:
|
||||
import pkg_resources
|
||||
from distutils.version import LooseVersion
|
||||
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
|
||||
HAS_DISTUTILS = True
|
||||
except ImportError:
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue