mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -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
|
@ -135,10 +135,10 @@ import re
|
|||
import shlex
|
||||
import sqlite3
|
||||
|
||||
from distutils.version import StrictVersion
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
|
||||
|
||||
|
||||
# Function used for executing commands.
|
||||
def execute_command(cmd, module):
|
||||
|
@ -435,7 +435,7 @@ def parse_package_name(names, pkg_spec, module):
|
|||
if pkg_spec[name]['branch']:
|
||||
branch_release = "6.0"
|
||||
|
||||
if StrictVersion(platform.release()) < StrictVersion(branch_release):
|
||||
if LooseVersion(platform.release()) < LooseVersion(branch_release):
|
||||
module.fail_json(msg="package name using 'branch' syntax requires at least OpenBSD %s: %s" % (branch_release, name))
|
||||
|
||||
# Sanity check that there are no trailing dashes in flavor.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue