Skip to content

Commit

Permalink
addressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Vibhu-gslab committed Feb 20, 2025
1 parent 01a08ec commit 8d08efb
Showing 1 changed file with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def router_bgp(self: AvdStructuredConfigCoreInterfacesAndL3EdgeProtocol) -> None
msg = f"{self.data_model}.p2p_links.[].as or {self.data_model}.p2p_links_profiles.[].as"
raise AristaAvdInvalidInputsError(msg)

neighbors = EosCliConfigGen.RouterBgp.NeighborsItem(
neighbor = EosCliConfigGen.RouterBgp.NeighborsItem(
remote_as=p2p_link_data["peer_bgp_as"],
peer=p2p_link_data["peer"],
description=p2p_link_data["peer"],
Expand All @@ -44,23 +44,17 @@ def router_bgp(self: AvdStructuredConfigCoreInterfacesAndL3EdgeProtocol) -> None

# RFC5549
if self.inputs.underlay_rfc5549 and p2p_link.routing_protocol != "ebgp":
self.structured_config.router_bgp.neighbor_interfaces.append_new(
name=p2p_link_data["interface"],
remote_as=p2p_link_data["peer_bgp_as"],
peer=p2p_link_data["peer"],
description=p2p_link_data["peer"],
peer_group=self.inputs.bgp_peer_groups.ipv4_underlay_peers.name,
)
self.structured_config.router_bgp.neighbor_interfaces.append_new(name=p2p_link_data["interface"], **neighbor._as_dict())
continue

# Regular BGP Neighbors
if p2p_link_data["ip"] is None or p2p_link_data["peer_ip"] is None:
msg = f"{self.data_model}.p2p_links.[].ip, .subnet or .ip_pool"
raise AristaAvdInvalidInputsError(msg)

neighbors.bfd = p2p_link.bfd
neighbor.bfd = p2p_link.bfd
if p2p_link_data["bgp_as"] != self.shared_utils.bgp_as:
neighbors.local_as = p2p_link_data["bgp_as"]
neighbor.local_as = p2p_link_data["bgp_as"]

neighbors.ip_address = get_ip_from_ip_prefix(p2p_link_data["peer_ip"])
self.structured_config.router_bgp.neighbors.append(neighbors)
neighbor.ip_address = get_ip_from_ip_prefix(p2p_link_data["peer_ip"])
self.structured_config.router_bgp.neighbors.append(neighbor)

0 comments on commit 8d08efb

Please sign in to comment.