From ee0620612bd20f4a6c528b311aa1a8640fa6de49 Mon Sep 17 00:00:00 2001 From: Daniel Ankers Date: Thu, 4 Jul 2024 14:50:57 +0100 Subject: [PATCH] Change link_peers to connected_endpoints; fix bug in snmpsection --- juniper-macros.j2 | 8 ++++---- juniper-vxlan.j2 | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/juniper-macros.j2 b/juniper-macros.j2 index 196fdbd..342777e 100644 --- a/juniper-macros.j2 +++ b/juniper-macros.j2 @@ -152,7 +152,7 @@ chassis { {% endif %} {% if interface.ip_addresses.count() > 0 %} unit 0 { -{% if (interface.link_peers) and (interface.link_peers[0].device.role.name == 'Provider Core') %} +{% if (interface.connected_endpoints) and (interface.connected_endpoints[0].device.role.name == 'Provider Core') %} vlan-id 1; {% endif %} family inet { @@ -183,8 +183,8 @@ chassis { storm-control default; } } -{% elif interface.device.role.name in ['Provider Core'] and interface.link_peers %} -{% if interface.link_peers[0].device.role.name in ['Provider Edge'] %} +{% elif interface.device.role.name in ['Provider Core'] and interface.connected_endpoints %} +{% if interface.connected_endpoints[0].device.role.name in ['Provider Edge'] %} {% for vlan in interface.tagged_vlans %} unit {{ vlan.vid }} { encapsulation vlan-vpls; @@ -202,7 +202,7 @@ interfaces { {% if device.role.name in ['Provider Core'] %} interface-range core-mpls { {% for interface in device.interfaces.filter(cable__isnull=False) %} -{% if interface.link_peers and interface.link_peers[0].device.role.name in ['Provider Core'] %} +{% if interface.connected_endpoints and interface.connected_endpoints[0].device.role.name in ['Provider Core'] %} member {{ interface }}; {% endif %} {% endfor %} diff --git a/juniper-vxlan.j2 b/juniper-vxlan.j2 index 8fbd760..b4642de 100644 --- a/juniper-vxlan.j2 +++ b/juniper-vxlan.j2 @@ -4,7 +4,7 @@ {{ junos.chassissection(device,breakout_ports) }} {% endif %} {{ junos.interfacesection(device,ipam.VLAN.objects.filter(tenant=device.tenant)) }} -{{ junos.snmpsection(device.rack, snmp) }} +{{ junos.snmpsection(device, snmp) }} {% if device.role.name == 'Leaf' %} forwarding-options { storm-control-profiles default {