diff --git a/src/zino/trapobservers/bgp_traps.py b/src/zino/trapobservers/bgp_traps.py index 449d1d67..767bf455 100644 --- a/src/zino/trapobservers/bgp_traps.py +++ b/src/zino/trapobservers/bgp_traps.py @@ -17,7 +17,6 @@ """ import logging -from ipaddress import ip_address from typing import Optional, Tuple from zino.statemodels import BGPOperState, BGPPeerSession, IPAddress @@ -73,10 +72,7 @@ def _pre_parse_trap(self, trap: TrapMessage) -> Tuple[IPAddress, BGPOperState]: raise MissingRequiredTrapVariables() try: - remote_addr = bytes(trap.get_all("jnxBgpM2PeerRemoteAddr")[0].raw_value) - peer = ip_address(remote_addr) - except ValueError: - raise ValueError(f"BGP transition trap received with invalid peer address: {remote_addr!r}") + peer = trap.get_all("jnxBgpM2PeerRemoteAddr")[0].value except IndexError: raise ValueError("BGP transition trap received without peer address")