Exemple #1
0
def assertBridgeClean(bridge, vlan, bonding, nics):
    ports = set(netinfo.ports(bridge))
    ifaces = set(nics)
    if vlan is not None:
        ifaces.add(vlan)
    else:
        ifaces.add(bonding)

    brifs = ports - ifaces

    if brifs:
        raise ConfigNetworkError(ne.ERR_USED_BRIDGE, "bridge %s has interfaces" " %s connected" % (bridge, brifs))
Exemple #2
0
def assertBridgeClean(bridge, vlan, bonding, nics):
    ports = set(netinfo.ports(bridge))
    ifaces = set(nics)
    if vlan is not None:
        ifaces.add('%s.%s' % ((bonding or nics[0]), vlan))
    else:
        ifaces.add(bonding)

    brifs = ports - ifaces

    if brifs:
        raise ConfigNetworkError(ne.ERR_USED_BRIDGE, 'bridge %s has interfaces'
                                 ' %s connected' % (bridge, brifs))
def assertBridgeClean(bridge, vlan, bonding, nics):
    ports = set(netinfo.ports(bridge))
    ifaces = set(nics)
    if vlan:
        ifaces.add((bonding or nics[0]) + '.' + vlan)
    else:
        ifaces.add(bonding)

    brifs = ports - ifaces

    if brifs:
        raise ConfigNetworkError(ne.ERR_USED_BRIDGE, 'bridge %s has interfaces'
                                 ' %s connected' % (bridge, brifs))
Exemple #4
0
def _update_bridge_ports_mtu(bridge, mtu):
    for port in netinfo.ports(bridge):
        ipwrapper.linkSet(port, ['mtu', str(mtu)])
Exemple #5
0
def _update_bridge_ports_mtu(bridge, mtu):
    for port in netinfo.ports(bridge):
        ipwrapper.linkSet(port, ['mtu', str(mtu)])