Ejemplo n.º 1
0
def test_get_upgrade_levels(mocker, levels, version, result, error):
    mocker.patch.dict("octane.magic_consts.UPGRADE_LEVELS", levels, clear=True)
    if error:
        msg = ("Could not find suitable upgrade_levels for the "
               "{version} release.".format(version=version))
        with pytest.raises(KeyError, message=msg):
            nova.get_upgrade_levels(version)
    else:
        assert nova.get_upgrade_levels(version) == result
Ejemplo n.º 2
0
def set_upgrade_levels(env):
    version = env.data["fuel_version"]
    openstack_release = nova.get_upgrade_levels(version)
    for node in get_nodes(env, ["controller", "compute"]):
        node_util.add_compute_upgrade_levels(node, openstack_release)
        node_util.restart_nova_services(node)