mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-12 15:05:07 +00: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)
This commit is contained in:
parent
73580d09e0
commit
e02568d28a
39 changed files with 102 additions and 59 deletions
|
|
@ -152,11 +152,11 @@ stdout:
|
|||
sample: "org.gnome.Calendar/x86_64/stable\tcurrent\norg.gnome.gitg/x86_64/stable\tcurrent\n"
|
||||
'''
|
||||
|
||||
from distutils.version import StrictVersion
|
||||
|
||||
from ansible.module_utils.six.moves.urllib.parse import urlparse
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
|
||||
|
||||
OUTDATED_FLATPAK_VERSION_ERROR_MESSAGE = "Unknown option --columns=application"
|
||||
|
||||
|
||||
|
|
@ -172,7 +172,7 @@ def install_flat(module, binary, remote, names, method, no_dependencies):
|
|||
id_names.append(name)
|
||||
base_command = [binary, "install", "--{0}".format(method)]
|
||||
flatpak_version = _flatpak_version(module, binary)
|
||||
if StrictVersion(flatpak_version) < StrictVersion('1.1.3'):
|
||||
if LooseVersion(flatpak_version) < LooseVersion('1.1.3'):
|
||||
base_command += ["-y"]
|
||||
else:
|
||||
base_command += ["--noninteractive"]
|
||||
|
|
@ -196,7 +196,7 @@ def uninstall_flat(module, binary, names, method):
|
|||
]
|
||||
command = [binary, "uninstall"]
|
||||
flatpak_version = _flatpak_version(module, binary)
|
||||
if StrictVersion(flatpak_version) < StrictVersion('1.1.3'):
|
||||
if LooseVersion(flatpak_version) < LooseVersion('1.1.3'):
|
||||
command += ["-y"]
|
||||
else:
|
||||
command += ["--noninteractive"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue