Exemplo n.º 1
0
def test_apply_all_tasks_error(mocker, mock_subprocess):
    mock_log = mocker.patch("octane.util.puppet.LOG")
    exc = subprocess.CalledProcessError(1, 'TEST_PROCESS')
    mock_subprocess.side_effect = exc
    with pytest.raises(subprocess.CalledProcessError):
        puppet_util.apply_all_tasks()
    mock_log.error.assert_called_once_with(
        "Cannot apply Puppet state on host: %s", exc)
Exemplo n.º 2
0
def test_apply_all_tasks(mock_subprocess):
    puppet_util.apply_all_tasks()
    expected_filename = "/etc/puppet/modules/fuel/examples/deploy.sh"
    mock_subprocess.assert_called_once_with([expected_filename])
Exemplo n.º 3
0
 def restore(self):
     subprocess.call(["systemctl", "stop"] + self.services)
     with keystone.admin_token_auth(magic_consts.KEYSTONE_PASTE,
                                    magic_consts.KEYSTONE_PIPELINES):
         puppet.apply_all_tasks()