def _assertBridgeClean(bridge, vlan, bonding, nics): ports = set(bridges.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))
def assertBridgeClean(bridge, vlan, bonding, nics): ports = set(bridges.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))
def _update_bridge_ports_mtu(bridge, mtu): for port in bridges.ports(bridge): ipwrapper.linkSet(port, ['mtu', str(mtu)])