Ejemplo n.º 1
0
# Refer to the README and COPYING files for full details of the license
#

from __future__ import absolute_import
from __future__ import division

from contextlib import contextmanager
import logging

from vdsm.common.config import config
from vdsm.network import bond_monitor
from vdsm.network import dhcp_monitor
from vdsm.network import lldp
from vdsm.network.ipwrapper import getLinks

Lldp = lldp.driver()


def init_privileged_network_components():
    _lldp_init()


def init_unprivileged_network_components(cif, net_api):
    dhcp_monitor.initialize_monitor(cif, net_api)
    bond_monitor.initialize_monitor(cif)


def stop_unprivileged_network_components():
    dhcp_monitor.Monitor.instance().stop()
    bond_monitor.stop()
Ejemplo n.º 2
0
#

from __future__ import absolute_import
from __future__ import division

from contextlib import contextmanager
import logging

from vdsm.common.config import config
from vdsm.network import dhclient_monitor
from vdsm.network import lldp
from vdsm.network.dhclient_monitor import dhclient_monitor_ctx
from vdsm.network.ipwrapper import getLinks
from vdsm.network.nm import networkmanager

Lldp = lldp.driver()


def init_privileged_network_components():
    networkmanager.init()
    _lldp_init()


def init_unprivileged_network_components(cif, net_api):
    _init_sourceroute(net_api)
    _register_notifications(cif)
    dhclient_monitor.start()


@contextmanager
def init_unpriviliged_dhclient_monitor_ctx(event_sink, net_api):