mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fix monit version check
it was erroneously checking > 3.18 instead of > 5.18 Fixes #30614
This commit is contained in:
parent
b26ae1809c
commit
34878926ca
1 changed files with 4 additions and 4 deletions
|
@ -79,11 +79,11 @@ def main():
|
||||||
# Use only major and minor even if there are more these should be enough
|
# Use only major and minor even if there are more these should be enough
|
||||||
return int(version[0]), int(version[1])
|
return int(version[0]), int(version[1])
|
||||||
|
|
||||||
def is_version_higher_than_18():
|
def is_version_higher_than_5_18():
|
||||||
return MONIT_MAJOR_VERSION > 3 or MONIT_MAJOR_VERSION == 3 and MONIT_MINOR_VERSION > 18
|
return (MONIT_MAJOR_VERSION, MONIT_MINOR_VERSION) > (5, 18)
|
||||||
|
|
||||||
def parse(parts):
|
def parse(parts):
|
||||||
if is_version_higher_than_18():
|
if is_version_higher_than_5_18():
|
||||||
return parse_current(parts)
|
return parse_current(parts)
|
||||||
else:
|
else:
|
||||||
return parse_older_versions(parts)
|
return parse_older_versions(parts)
|
||||||
|
@ -138,7 +138,7 @@ def main():
|
||||||
|
|
||||||
MONIT_MAJOR_VERSION, MONIT_MINOR_VERSION = monit_version()
|
MONIT_MAJOR_VERSION, MONIT_MINOR_VERSION = monit_version()
|
||||||
|
|
||||||
SUMMARY_COMMAND = ('summary', 'summary -B')[is_version_higher_than_18()]
|
SUMMARY_COMMAND = ('summary', 'summary -B')[is_version_higher_than_5_18()]
|
||||||
|
|
||||||
if state == 'reloaded':
|
if state == 'reloaded':
|
||||||
if module.check_mode:
|
if module.check_mode:
|
||||||
|
|
Loading…
Reference in a new issue