Beispiel #1
0
def bondings_caps(running_config):
    ovs_bonding_caps = {}
    routes = netinfo_routes.get_routes()
    for bonding, attrs in iter_ovs_bonds(running_config.bonds):
        options = get_bond_options(attrs.get('options'), keep_custom=True)
        net_info = _get_net_info(bonding, routes)
        net_info['slaves'] = attrs.get('nics')
        net_info['active_slave'] = _get_active_slave(bonding)
        net_info['opts'] = options
        ovs_bonding_caps[bonding] = net_info
    return ovs_bonding_caps
Beispiel #2
0
def networks_caps(running_config):
    ovs_networks_caps = {}
    routes = netinfo_routes.get_routes()
    for network, attrs in iter_ovs_nets(running_config.networks):
        interface = network if 'vlan' in attrs else BRIDGE_NAME
        net_info = _get_net_info(interface, routes)
        net_info['iface'] = network
        net_info['bridged'] = True
        net_info['ports'] = _get_ports(network, attrs)
        net_info['stp'] = _get_stp(interface)
        ovs_networks_caps[network] = net_info
    return ovs_networks_caps
Beispiel #3
0
def networks_caps(running_config):
    ovs_networks_caps = {}
    routes = netinfo_routes.get_routes()
    for network, attrs in iter_ovs_nets(running_config.networks):
        interface = network if 'vlan' in attrs else BRIDGE_NAME
        net_info = _get_net_info(interface, routes)
        net_info['iface'] = network
        # report the network to be bridgeless if this is what Engine expects
        net_info['bridged'] = attrs.get('bridged')
        net_info['ports'] = _get_ports(network, attrs)
        net_info['stp'] = _get_stp(interface)
        ovs_networks_caps[network] = net_info
    return ovs_networks_caps
Beispiel #4
0
def vlans_caps(running_config):
    ovs_vlans_caps = {}
    routes = netinfo_routes.get_routes()
    for network, attrs in iter_ovs_nets(running_config.networks):
        vlan = attrs.get('vlan')
        if vlan is not None:
            net_info = _get_net_info(network, routes)
            iface = attrs.get('bonding') or attrs.get('nic')
            net_info['iface'] = iface
            net_info['bridged'] = attrs.get('bridged')
            net_info['vlanid'] = int(vlan)
            ovs_vlans_caps['%s.%s' % (iface, vlan)] = net_info
    return ovs_vlans_caps
Beispiel #5
0
def bondings_caps(running_config):
    ovs_bonding_caps = {}
    dhcpv4ifaces, dhcpv6ifaces = dhcp.get_dhclient_ifaces()
    routes = netinfo_routes.get_routes()
    for bonding, attrs in iter_ovs_bonds(running_config.bonds):
        options = get_bond_options(attrs.get('options'), keep_custom=True)
        net_info = _get_net_info(attrs, bonding, dhcpv4ifaces, dhcpv6ifaces,
                                 routes)
        net_info['slaves'] = attrs.get('nics')
        net_info['active_slave'] = _get_active_slave(bonding)
        net_info['opts'] = options
        ovs_bonding_caps[bonding] = net_info
    return ovs_bonding_caps
Beispiel #6
0
def bridges_caps(running_config):
    ovs_bridges_caps = {}
    routes = netinfo_routes.get_routes()
    for network, attrs in iter_ovs_nets(running_config.networks):
        interface = network if 'vlan' in attrs else BRIDGE_NAME
        net_info = _get_net_info(interface, routes)
        net_info['bridged'] = True
        net_info['ports'] = _get_ports(network, attrs)
        # TODO netinfo._bridge_options does not work here
        net_info['opts'] = {}
        net_info['stp'] = _get_stp(interface)
        ovs_bridges_caps[network] = net_info
    return ovs_bridges_caps
Beispiel #7
0
def networks_caps(running_config):
    ovs_networks_caps = {}
    dhcpv4ifaces, dhcpv6ifaces = dhcp.get_dhclient_ifaces()
    routes = netinfo_routes.get_routes()
    for network, attrs in iter_ovs_nets(running_config.networks):
        interface = network if 'vlan' in attrs else BRIDGE_NAME
        net_info = _get_net_info(attrs, interface, dhcpv4ifaces, dhcpv6ifaces,
                                 routes)
        net_info['iface'] = network
        net_info['bridged'] = True
        net_info['ports'] = _get_ports(network, attrs)
        net_info['stp'] = _get_stp(interface)
        ovs_networks_caps[network] = net_info
    return ovs_networks_caps
Beispiel #8
0
def vlans_caps(running_config):
    ovs_vlans_caps = {}
    dhcpv4ifaces, dhcpv6ifaces = dhcp.get_dhclient_ifaces()
    routes = netinfo_routes.get_routes()
    for network, attrs in iter_ovs_nets(running_config.networks):
        vlan = attrs.get('vlan')
        if vlan is not None:
            net_info = _get_net_info(attrs, network, dhcpv4ifaces,
                                     dhcpv6ifaces, routes)
            iface = attrs.get('bonding') or attrs.get('nic')
            net_info['iface'] = iface
            net_info['bridged'] = True
            net_info['vlanid'] = int(vlan)
            ovs_vlans_caps['%s.%s' % (iface, vlan)] = net_info
    return ovs_vlans_caps