mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-21 20:59:10 +00:00
monit: deprecate support for monit <= 5.18 (#11254)
* monit: deprecate support for monit <= 5.18 * add additional runs for checking version * add changelog frag * bump deprecation for 14.0.0
This commit is contained in:
parent
c8fe1e571f
commit
cc24e57307
4 changed files with 16 additions and 2 deletions
|
|
@ -24,6 +24,7 @@ class MonitTest(unittest.TestCase):
|
|||
self.module = mock.MagicMock()
|
||||
self.module.exit_json.side_effect = AnsibleExitJson
|
||||
self.module.fail_json.side_effect = AnsibleFailJson
|
||||
self.module.run_command.return_value = (0, "This is monit version 5.26.0", "")
|
||||
self.monit = monit.Monit(self.module, "monit", "processX", 1)
|
||||
self.monit._status_change_retry_count = 1
|
||||
mock_sleep = mock.patch("time.sleep")
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ test_cases:
|
|||
|
||||
# ------------------------------------------------------------------ reload
|
||||
- id: state_reloaded
|
||||
# reload exits before any presence/status checks; no version check either
|
||||
# reload exits before any presence/status checks; version check happens in __init__
|
||||
input:
|
||||
name: processX
|
||||
state: reloaded
|
||||
|
|
@ -366,6 +366,7 @@ test_cases:
|
|||
state: reloaded
|
||||
mocks:
|
||||
run_command:
|
||||
- *version_526
|
||||
- command: [/testbin/monit, reload]
|
||||
environ: {}
|
||||
rc: 0
|
||||
|
|
@ -396,7 +397,7 @@ test_cases:
|
|||
|
||||
# ------------------------------------------------------------------ failure cases
|
||||
- id: state_reloaded_fail
|
||||
# reload returns rc=1 → fail_json("monit reload failed")
|
||||
# reload returns rc=1 → fail_json("monit reload failed"); version check happens in __init__
|
||||
input:
|
||||
name: processX
|
||||
state: reloaded
|
||||
|
|
@ -404,6 +405,7 @@ test_cases:
|
|||
failed: true
|
||||
mocks:
|
||||
run_command:
|
||||
- *version_526
|
||||
- command: [/testbin/monit, reload]
|
||||
environ: {}
|
||||
rc: 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue