Ejemplo n.º 1
0
def test_reloadAll(mConfig, mBlocking, mDeffered):
    mDeffered.return_value = 'test'
    mBlocking.return_value = MagicMock()
    mBlocking.return_value.wait.return_value = 'wait test'
    assert client.reloadAll(dbus=True) == 'wait test'
    mDeffered.assert_called_once_with('ReloadAll')
    mBlocking.assert_called_once_with('test')

    mConfig.configManager.loadConfig.return_value = "new test"
    assert client.reloadAll() == 'new test'
Ejemplo n.º 2
0
def reloadAll(update):
    # Note: reloading all config files at once seems safer than individual
    # files because of cross-dependencies.
    statusString = client.reloadAll()

    # Check the status to make sure all configuration sections
    # related to this chute were successfully loaded.
    status = json.loads(statusString)
    for section in status:
        if section['comment'] == update.name:
            if not section['success']:
                out.err("Error installing configuration section {} {}".format(
                        section['type'], section['name']))
                raise Exception("Error preparing host environment for chute")