mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-02-04 07:51:50 +00:00
[stable-11] monit: fix check for pending (#11253)
* monit: fix check for pending * add changelog frag * adjust testcases
This commit is contained in:
parent
df3898b08c
commit
364e491b7e
3 changed files with 7 additions and 5 deletions
2
changelogs/fragments/11245-monit-enum.yml
Normal file
2
changelogs/fragments/11245-monit-enum.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- monit - internal state was not reflecting when operation is "pending" in ``monit`` (https://github.com/ansible-collections/community.general/pull/11245).
|
||||
|
|
@ -187,7 +187,7 @@ class Monit(object):
|
|||
else:
|
||||
status = Status.NOT_MONITORED
|
||||
|
||||
if state == 'pending':
|
||||
if state == 'PENDING':
|
||||
status = status.pending()
|
||||
return status
|
||||
|
||||
|
|
|
|||
|
|
@ -116,10 +116,10 @@ BASIC_OUTPUT_CASES = [
|
|||
@pytest.mark.parametrize('output, expected', BASIC_OUTPUT_CASES + [
|
||||
('', monit.Status.MISSING),
|
||||
(TEST_OUTPUT % ('Process', 'processY', 'OK'), monit.Status.MISSING),
|
||||
(TEST_OUTPUT % ('Process', 'processX', 'Not Monitored - start pending'), monit.Status.OK),
|
||||
(TEST_OUTPUT % ('Process', 'processX', 'Monitored - stop pending'), monit.Status.NOT_MONITORED),
|
||||
(TEST_OUTPUT % ('Process', 'processX', 'Monitored - restart pending'), monit.Status.OK),
|
||||
(TEST_OUTPUT % ('Process', 'processX', 'Not Monitored - monitor pending'), monit.Status.OK),
|
||||
(TEST_OUTPUT % ('Process', 'processX', 'Not Monitored - start pending'), monit.Status.OK.pending()),
|
||||
(TEST_OUTPUT % ('Process', 'processX', 'Monitored - stop pending'), monit.Status.NOT_MONITORED.pending()),
|
||||
(TEST_OUTPUT % ('Process', 'processX', 'Monitored - restart pending'), monit.Status.OK.pending()),
|
||||
(TEST_OUTPUT % ('Process', 'processX', 'Not Monitored - monitor pending'), monit.Status.OK.pending()),
|
||||
(TEST_OUTPUT % ('Process', 'processX', 'Does not exist'), monit.Status.DOES_NOT_EXIST),
|
||||
(TEST_OUTPUT % ('Process', 'processX', 'Not monitored'), monit.Status.NOT_MONITORED),
|
||||
(TEST_OUTPUT % ('Process', 'processX', 'Running'), monit.Status.OK),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue