Sort interface names - requires using 'natsort' module and configuring custom Jinja2 filter
parent
1392e221c7
commit
73895d1e5d
|
|
@ -213,13 +213,7 @@ interfaces {
|
|||
}
|
||||
{% endif %}
|
||||
{# Physical interfaces should be sorted by FPC/PIC/Port value - that's a challenge to do in Jinja so we cheat for now by putting the xe- interfaces first. This won't work for all devices! #}
|
||||
{% for interface in device.interfaces.filter(name__startswith='ge-') %}
|
||||
{{ interfaceconfig(interface) }}
|
||||
{% endfor %}
|
||||
{% for interface in device.interfaces.filter(name__startswith='xe-') %}
|
||||
{{ interfaceconfig(interface) }}
|
||||
{% endfor %}
|
||||
{% for interface in device.interfaces.filter(name__startswith='et-') %}
|
||||
{% for interface in device.interfaces.filter(name__contains='-')|natsort %}
|
||||
{{ interfaceconfig(interface) }}
|
||||
{% endfor %}
|
||||
{% for interface in device.interfaces.filter(name__startswith='ae') %}
|
||||
|
|
|
|||
Loading…
Reference in New Issue