diff --git a/ubiquiti-edge-router.j2 b/ubiquiti-edge-router.j2 index ce326a7..055d152 100644 --- a/ubiquiti-edge-router.j2 +++ b/ubiquiti-edge-router.j2 @@ -6,19 +6,13 @@ {% set device = dcim.Device.objects.get(pk=device_id) %} {% endif %} -{# cursed pipeline to get all possible ethernet-like type #} -{%- set ether_types = dcim.Interface._meta.get_field("type").choices | - selectattr(0, "in", ["Ethernet (fixed)", "Ethernet (modular)", "Ethernet (backplane)"]) | - map(attribute=1) | sum(start=[]) | map(attribute=0) | list -%} - {%- for intf in device.interfaces.all() %} {# Loopback #} {%- if intf.name == "lo" %}{% set iftype = "loopback" %}{% endif %} {# Ethernet #} -{%- if intf.type in ether_types %} +{%- if intf.type not in ["virtual", "other", "bridge", "lag"] %} {%- set iftype = "ethernet" %} {%- endif %}