Skip to content

Commit

Permalink
When asPathType is Internal (IBGP), as_path is empty and the remote-a…
Browse files Browse the repository at this point in the history
…s is the local_as (#1064)
  • Loading branch information
mirceaulinic authored Oct 9, 2019
1 parent a476332 commit c3db556
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion napalm/eos/eos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,13 @@ def get_route_to(self, destination="", protocol=""):
as_path = bgp_route_details.get("asPathEntry", {}).get(
"asPath", ""
)
remote_as = int(as_path.strip("()").split()[-1])
as_path_type = bgp_route_details.get("asPathEntry", {}).get(
"asPathType", ""
)
if as_path_type in ["Internal", "Local"]:
remote_as = local_as
else:
remote_as = int(as_path.strip("()").split()[-1])
remote_address = napalm.base.helpers.ip(
bgp_route_details.get("routeDetail", {})
.get("peerEntry", {})
Expand Down

0 comments on commit c3db556

Please sign in to comment.