Пример #1
0
    def _get_interface_choices(device_type):
        """Return a list of choices for a given device type."""
        interfaces = network.get_interface_list(device_type)
        # Support for virtual Ethernet devices used in containers
        if device_type == nm.DeviceType.ETHERNET:
            interfaces.update(network.get_interface_list(nm.DeviceType.VETH))

        choices = [('', _('-- select --'))]
        for interface, mac in interfaces.items():
            display_string = '{interface} ({mac})'.format(interface=interface,
                                                          mac=mac)
            choices.append((interface, display_string))

        return choices
Пример #2
0
def _get_interface_choices(device_type):
    """Return a list of choices for a given device type."""
    interfaces = network.get_interface_list(device_type)
    choices = [('', _('-- select --'))]
    for interface, mac in interfaces.items():
        display_string = '{interface} ({mac})'.format(interface=interface,
                                                      mac=mac)
        choices.append((interface, display_string))

    return choices
Пример #3
0
def _get_interface_choices(device_type):
    """Return a list of choices for a given device type."""
    interfaces = network.get_interface_list(device_type)
    choices = [('', _('-- select --'))]
    for interface, mac in interfaces.items():
        display_string = '{interface} ({mac})'.format(interface=interface,
                                                      mac=mac)
        choices.append((interface, display_string))

    return choices