示例#1
0
def unified_restoration():
    """
    Builds a setupNetworks command from the persistent configuration to set it
    as running configuration.
    """
    networkmanager.init()

    persistent_config = PersistentConfig()
    available_config = _filter_available(persistent_config)

    _verify_all_devices_are_up(list(_owned_ifcfg_files()))

    _wait_for_for_all_devices_up(available_config.networks.keys() +
                                 available_config.bonds.keys())

    if ipv6_supported():
        _restore_disable_ipv6()

    classified_conf = _classify_nets_bonds_config(available_config)
    setup_nets, setup_bonds, remove_nets, remove_bonds = classified_conf

    logging.info('Remove networks (%s) and bonds (%s).', remove_nets,
                 remove_bonds)
    _greedy_setup_bonds(remove_bonds)
    _greedy_setup_nets(remove_nets)

    _restore_non_vdsm_net_devices()

    _convert_to_blocking_dhcp(setup_nets)
    logging.info('Setup networks (%s) and bonds (%s).', setup_nets,
                 setup_bonds)
    _greedy_setup_bonds(setup_bonds)
    _greedy_setup_nets(setup_nets)
示例#2
0
def unified_restoration():
    """
    Builds a setupNetworks command from the persistent configuration to set it
    as running configuration.
    """
    networkmanager.init()

    persistent_config = PersistentConfig()
    available_config = _filter_available(persistent_config)

    _verify_all_devices_are_up(list(_owned_ifcfg_files()))

    _wait_for_for_all_devices_up(
        available_config.networks.keys() + available_config.bonds.keys())

    if ipv6_supported():
        _restore_disable_ipv6()

    classified_conf = _classify_nets_bonds_config(available_config)
    setup_nets, setup_bonds, remove_nets, remove_bonds = classified_conf

    logging.info(
        'Remove networks (%s) and bonds (%s).', remove_nets, remove_bonds)
    _greedy_setup_bonds(remove_bonds)
    _greedy_setup_nets(remove_nets)

    _restore_non_vdsm_net_devices()

    _convert_to_blocking_dhcp(setup_nets)
    logging.info(
        'Setup networks (%s) and bonds (%s).', setup_nets, setup_bonds)
    _greedy_setup_bonds(setup_bonds)
    _greedy_setup_nets(setup_nets)
示例#3
0
def setup_module():
    global _nm_service
    _nm_service = NMService()
    _nm_service.setup()
    try:
        networkmanager.init()
    except DBusException as ex:
        # Unfortunately, nose labeling does not operate on module fixtures.
        # We let the test fail if init was not successful.
        if 'Failed to connect to socket' not in ex.args[0]:
            raise
示例#4
0
文件: nm_test.py 项目: EdDev/vdsm
def setup_module():
    global _nm_service
    _nm_service = NMService()
    _nm_service.setup()
    try:
        networkmanager.init()
    except DBusException as ex:
        # Unfortunately, nose labeling does not operate on module fixtures.
        # We let the test fail if init was not successful.
        if 'Failed to connect to socket' not in ex.args[0]:
            raise
示例#5
0
文件: nm_test.py 项目: vjuranek/vdsm
def setup():
    requires_systemctl()
    nm_service = NMService()
    nm_service.setup()
    try:
        networkmanager.init()
    except DBusException as ex:
        if 'Failed to connect to socket' not in ex.args[0]:
            pytest.skip('dbus socket or the NM service may not be available')
    yield
    nm_service.teardown()
示例#6
0
def init_privileged_network_components():
    networkmanager.init()
    _lldp_init()
示例#7
0
文件: initializer.py 项目: EdDev/vdsm
def init_privileged_network_components():
    networkmanager.init()
示例#8
0
def init():
    logging.info('Initializing VDSM components.')
    networkmanager.init()