From 34878926cac68b4c5a9df4137cfef44fa11c7c87 Mon Sep 17 00:00:00 2001 From: Daniel Roberts Date: Mon, 2 Oct 2017 15:06:04 -0400 Subject: [PATCH] fix monit version check it was erroneously checking > 3.18 instead of > 5.18 Fixes #30614 --- lib/ansible/modules/monitoring/monit.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/monitoring/monit.py b/lib/ansible/modules/monitoring/monit.py index 0364bc1e807..9c9edd63268 100644 --- a/lib/ansible/modules/monitoring/monit.py +++ b/lib/ansible/modules/monitoring/monit.py @@ -79,11 +79,11 @@ def main(): # Use only major and minor even if there are more these should be enough return int(version[0]), int(version[1]) - def is_version_higher_than_18(): - return MONIT_MAJOR_VERSION > 3 or MONIT_MAJOR_VERSION == 3 and MONIT_MINOR_VERSION > 18 + def is_version_higher_than_5_18(): + return (MONIT_MAJOR_VERSION, MONIT_MINOR_VERSION) > (5, 18) def parse(parts): - if is_version_higher_than_18(): + if is_version_higher_than_5_18(): return parse_current(parts) else: return parse_older_versions(parts) @@ -138,7 +138,7 @@ def main(): 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 module.check_mode: