monit - invoke run_command passing list (#3821)

* monit - invoke run_command passing list

* added changelog fragment

* fixed unit test

* further adjustments

* fixed handling of command_args

* better handling of command_args
This commit is contained in:
Alexei Znamensky 2021-12-02 19:50:02 +13:00 committed by GitHub
commit 52d4907480
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):