# Path: os_vif/internal/ip/api.py
# LOG = logging.getLogger(__name__)
# 
# Path: vif_plug_linux_bridge/privsep.py



import os
from os_vif.internal.ip.api import ip as ip_lib
from oslo_concurrency import lockutils
from oslo_concurrency import processutils
from oslo_log import log as logging
from vif_plug_linux_bridge import privsep
    for fields in old_routes:
        processutils.execute('ip', 'route', 'add', *fields)


@privsep.vif_plug.entrypoint
def _ensure_bridge_privileged(bridge, interface, net_attrs, gateway,
                              filtering=True, mtu=None):
    """Create a bridge unless it already exists.

    :param interface: the interface to create the bridge on.
    :param net_attrs: dictionary with  attributes used to create bridge.
    :param gateway: whether or not the bridge is a gateway.
    :param filtering: whether or not to create filters on the bridge.
    :param mtu: MTU of bridge.

    If net_attrs is set, it will add the net_attrs['gateway'] to the bridge
    using net_attrs['broadcast'] and net_attrs['cidr'].  It will also add
    the ip_v6 address specified in net_attrs['cidr_v6'] if use_ipv6 is set.

    The code will attempt to move any ips that already exist on the
    interface onto the bridge and reset the default gateway if necessary.

    """
    if not ip_lib.exists(bridge):
        LOG.debug('Starting Bridge %s', bridge)
        ip_lib.add(bridge, 'bridge')
        _disable_ipv6(bridge)
        _arp_filtering(bridge)
        ip_lib.set(bridge, state='up')


# Path: os_vif/internal/ip/api.py
# LOG = logging.getLogger(__name__)
# 
# Path: vif_plug_linux_bridge/privsep.py



# Path: vif_plug_linux_bridge/linux_net.py
import os
from os_vif.internal.ip.api import ip as ip_lib
from oslo_concurrency import lockutils
from oslo_concurrency import processutils
from oslo_log import log as logging
from vif_plug_linux_bridge import privsep

    for fields in old_routes:
        processutils.execute('ip', 'route', 'add', *fields)


@privsep.vif_plug.entrypoint
def _ensure_bridge_privileged(bridge, interface, net_attrs, gateway,
                              filtering=True, mtu=None):
    """Create a bridge unless it already exists.

    :param interface: the interface to create the bridge on.
    :param net_attrs: dictionary with  attributes used to create bridge.
    :param gateway: whether or not the bridge is a gateway.
    :param filtering: whether or not to create filters on the bridge.
    :param mtu: MTU of bridge.

    If net_attrs is set, it will add the net_attrs['gateway'] to the bridge
    using net_attrs['broadcast'] and net_attrs['cidr'].  It will also add
    the ip_v6 address specified in net_attrs['cidr_v6'] if use_ipv6 is set.

    The code will attempt to move any ips that already exist on the
    interface onto the bridge and reset the default gateway if necessary.

    """
    if not ip_lib.exists(bridge):
        LOG.debug('Starting Bridge %s', bridge)
        ip_lib.add(bridge, 'bridge')
        _disable_ipv6(bridge)
        _arp_filtering(bridge)
        ip_lib.set(bridge, state='up')


    if interface and ip_lib.exists(interface):