diff --git a/CHANGELOG b/CHANGELOG index 7076676c7e3cf591daec593095d7b34646aaf757..a51514e51c0a80371bb602294a04b56233989ee1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,3 +3,4 @@ 2022-05-09: added item to BgpPeer class, this is used in the discovery function 2022-05-11: changed bgp_get_peer_entry to get proper parameters instead of Nontransparent list added remote_as to BgpPeerItem +2023-01-25: fixed routing instance in item diff --git a/agent_based/juniper_bgp_peer.py b/agent_based/juniper_bgp_peer.py index 6b9075adc4ab8dde23d8faa0254d7ea252274ac0..7d19cea9612502db7e0245c041a76bd169614745 100644 --- a/agent_based/juniper_bgp_peer.py +++ b/agent_based/juniper_bgp_peer.py @@ -15,7 +15,7 @@ # 2022-05-09: added item to BgpPeer class, this is used in the discovery function # 2022-05-11: changed bgp_get_peer_entry to get proper parameters instead of Nontransparent list # added remote_as to BgpPeerItem -# +# 2023-01-25: fixed routing instance in item import copy from typing import List, Dict, Optional, Tuple @@ -54,6 +54,7 @@ class JuniperPrefixes: def parse_juniper_bgp_peer(string_table: List[StringByteTable]) -> Optional[Dict[str, BgpPeer]]: jnxBgpM2Peer, jnxBgpM2PrefixCountersEntry = string_table + peer_table = {} peer_prefixes = {} @@ -105,10 +106,8 @@ def parse_juniper_bgp_peer(string_table: List[StringByteTable]) -> Optional[Dict address_family_str = juniper_afi_safi_mapping(address_family.afi, address_family.safi) item = f'{remote_addr} {address_family_str}' # ToDo: add vrf name - routing_instance = '' - if routing_instance != '0': - routing_instance = f'VR {routing_instance}' - item = f'{item} {routing_instance}' + routing_instance = f'VR {routing_instance}' + item = f'{item} {routing_instance}' peer_table[item] = copy.deepcopy(bgp_peer[remote_addr]) peer_table[item].accepted_prefixes = address_family.accepted_prefixes peer_table[item].metric_count += address_family.metric_count diff --git a/juniper_bgp_peer.mkp b/juniper_bgp_peer.mkp index 3487a92b4b24004a5a7a0af434f349c58fbfc446..35fa375c97fb80499e9157bbf0fcea6393a3c5f1 100644 Binary files a/juniper_bgp_peer.mkp and b/juniper_bgp_peer.mkp differ