mirror of
https://github.com/ansible/awx.git
synced 2026-03-16 00:17:29 -02:30
Add supervisorctl logs
In some systems, the tower service process may not have sufficient permissions to communicate with the supervisorctl socket, in which case an automated restart will not be possible.
This commit is contained in:
@@ -3,10 +3,15 @@ from awx.main.utils import reload
|
||||
|
||||
|
||||
def test_produce_supervisor_command(mocker):
|
||||
with mocker.patch.object(reload.subprocess, 'Popen'):
|
||||
communicate_mock = mocker.MagicMock(return_value=('Everything is fine', ''))
|
||||
mock_process = mocker.MagicMock()
|
||||
mock_process.communicate = communicate_mock
|
||||
Popen_mock = mocker.MagicMock(return_value=mock_process)
|
||||
with mocker.patch.object(reload.subprocess, 'Popen', Popen_mock):
|
||||
reload._supervisor_service_command(['beat', 'callback', 'fact'], "restart")
|
||||
reload.subprocess.Popen.assert_called_once_with(
|
||||
['supervisorctl', 'restart', 'tower-processes:receiver', 'tower-processes:factcacher'])
|
||||
['supervisorctl', 'restart', 'tower-processes:receiver', 'tower-processes:factcacher'],
|
||||
stderr=-1, stdin=-1, stdout=-1)
|
||||
|
||||
|
||||
def test_routing_of_service_restarts_works(mocker):
|
||||
|
||||
Reference in New Issue
Block a user