VLANs section and AE interfaces should be sorted alphabetically by name

main
Daniel Ankers 2024-01-22 11:35:56 +00:00
parent 91110cf203
commit 4b6297e832
1 changed files with 2 additions and 2 deletions

View File

@ -147,7 +147,7 @@ interfaces {
{% for interface in device['interfaces'] if interface['name'].startswith('et-') %} {% for interface in device['interfaces'] if interface['name'].startswith('et-') %}
{{ interfaceconfig(interface) }} {{ interfaceconfig(interface) }}
{% endfor %} {% endfor %}
{% for interface in device['interfaces'] if interface['name'].startswith('ae') %} {% for interface in device['interfaces']|sort(attribute='name') if interface['name'].startswith('ae') %}
{{ interfaceconfig(interface,device['rack']['name'][5:]) }} {{ interfaceconfig(interface,device['rack']['name'][5:]) }}
{% endfor %} {% endfor %}
{% for interface in device['interfaces'] if interface['name']=='em0' %} {% for interface in device['interfaces'] if interface['name']=='em0' %}
@ -303,7 +303,7 @@ routing-options {
{% macro vlanssection(vlans,device) %} {% macro vlanssection(vlans,device) %}
vlans { vlans {
{# This next line selects all of the VLANs which are configured on this device #} {# This next line selects all of the VLANs which are configured on this device #}
{% for vlan in vlans|sort(attribute='vid') if (device['interfaces']|selectattr('untagged_vlan.vid','equalto',vlan)|list|count or interfaces|map(attribute='tagged_vlans')|sum(start=[])|selectattr('vid','equalto',vlan)|list|count) or device['interfaces']|selectattr('name', 'equalto', 'irb.'+vlan['vid']|string)|list|count %} {% for vlan in vlans|sort(attribute='name') if (device['interfaces']|selectattr('untagged_vlan.vid','equalto',vlan)|list|count or interfaces|map(attribute='tagged_vlans')|sum(start=[])|selectattr('vid','equalto',vlan)|list|count) or device['interfaces']|selectattr('name', 'equalto', 'irb.'+vlan['vid']|string)|list|count %}
vl{{ vlan['vid'] }} { vl{{ vlan['vid'] }} {
{% if vlan['name'] != '' %} {% if vlan['name'] != '' %}
description "{{ vlan['name'] }}"; description "{{ vlan['name'] }}";