monit - invoke run_command passing list (#3821) (#3832)

* monit - invoke run_command passing list

* added changelog fragment

* fixed unit test

* further adjustments

* fixed handling of command_args

* better handling of command_args

(cherry picked from commit 52d4907480)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2021-12-02 08:12:52 +01:00 committed by GitHub
commit fad1220869
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 7 deletions

View file

@ -40,7 +40,7 @@ class MonitTest(unittest.TestCase):
with self.assertRaises(AnsibleExitJson):
self.monit.stop()
self.module.fail_json.assert_not_called()
self.module.run_command.assert_called_with('monit stop processX', check_rc=True)
self.module.run_command.assert_called_with(['monit', 'stop', 'processX'], check_rc=True)
def test_change_state_fail(self):
with self.patch_status([monit.Status.OK] * 3):