Esempio n. 1
0
File: api.py Progetto: nickxiao/vdsm
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))
Esempio n. 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))
Esempio n. 3
0
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))
Esempio n. 4
0
File: api.py Progetto: Caez83/vdsm
def _update_bridge_ports_mtu(bridge, mtu):
    for port in netinfo.ports(bridge):
        ipwrapper.linkSet(port, ['mtu', str(mtu)])
Esempio n. 5
0
def _update_bridge_ports_mtu(bridge, mtu):
    for port in netinfo.ports(bridge):
        ipwrapper.linkSet(port, ['mtu', str(mtu)])