mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-08 17:34:01 -07:00
[PR #10743/469e557b backport][stable-10] monit: handle arbitrary error status (#10759)
Some checks are pending
EOL CI / EOL Sanity (Ⓐ2.15) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py2.7) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py3.10) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py3.5) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/3/) (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run
Some checks are pending
EOL CI / EOL Sanity (Ⓐ2.15) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py2.7) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py3.10) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py3.5) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/3/) (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run
monit: handle arbitrary error status (#10743)
* handle arbitrary error status
* add changelog fragment
* mock module in test
* Update changelogs/fragments/10743-monit-handle-unknown-status.yml
---------
(cherry picked from commit 469e557b95
)
Co-authored-by: Simon Kelly <skelly@dimagi.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
0dab7c8f3b
commit
94699318e2
3 changed files with 10 additions and 2 deletions
|
@ -124,9 +124,11 @@ BASIC_OUTPUT_CASES = [
|
|||
(TEST_OUTPUT % ('Process', 'processX', 'Not monitored'), monit.Status.NOT_MONITORED),
|
||||
(TEST_OUTPUT % ('Process', 'processX', 'Running'), monit.Status.OK),
|
||||
(TEST_OUTPUT % ('Process', 'processX', 'Execution failed | Does not exist'), monit.Status.EXECUTION_FAILED),
|
||||
(TEST_OUTPUT % ('Process', 'processX', 'Some Unknown Status'), monit.Status.EXECUTION_FAILED),
|
||||
])
|
||||
def test_parse_status(output, expected):
|
||||
status = monit.Monit(None, '', 'processX', 0)._parse_status(output, '')
|
||||
module = mock.MagicMock()
|
||||
status = monit.Monit(module, '', 'processX', 0)._parse_status(output, '')
|
||||
assert status == expected
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue