Skip to content

Commit

Permalink
fixing eos_designs code
Browse files Browse the repository at this point in the history
  • Loading branch information
Vibhu-gslab committed Oct 17, 2024
1 parent 3555b48 commit a3d5cbf
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ ethernet_interfaces:
switchport:
enabled: true
link_tracking_groups:
- name: l2leaf-server02
names:
- l2leaf-server02
direction: downstream
port_channel_interfaces:
- name: Port-Channel1
Expand All @@ -117,7 +118,8 @@ port_channel_interfaces:
allowed_vlan: '310'
shutdown: false
link_tracking_groups:
- name: l2leaf-server02
names:
- l2leaf-server02
direction: upstream
vlans:
- id: 310
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ ethernet_interfaces:
switchport:
enabled: false
link_tracking_groups:
- name: LT_GROUP1
names:
- LT_GROUP1
direction: upstream
ip_address: 10.10.101.1/31
- name: Ethernet10
Expand Down Expand Up @@ -436,7 +437,8 @@ port_channel_interfaces:
description: server01_ES1_PortChanne1
shutdown: false
link_tracking_groups:
- name: LT_GROUP1
names:
- LT_GROUP1
direction: downstream
switchport:
enabled: true
Expand All @@ -450,7 +452,8 @@ port_channel_interfaces:
description: server03_AUTO_ESI_Auto-ESI PortChannel
shutdown: false
link_tracking_groups:
- name: LT_GROUP1
names:
- LT_GROUP1
direction: downstream
switchport:
enabled: true
Expand All @@ -464,7 +467,8 @@ port_channel_interfaces:
description: server04_AUTO_ESI_Profile_Auto-ESI PortChannel from profile
shutdown: false
link_tracking_groups:
- name: LT_GROUP1
names:
- LT_GROUP1
direction: downstream
switchport:
enabled: true
Expand All @@ -478,7 +482,8 @@ port_channel_interfaces:
description: server05_AUTO_ESI_Profile_Override_Auto-ESI PortChannel overridden on server
shutdown: false
link_tracking_groups:
- name: LT_GROUP1
names:
- LT_GROUP1
direction: downstream
switchport:
enabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ ethernet_interfaces:
switchport:
enabled: false
link_tracking_groups:
- name: LT_GROUP1
names:
- LT_GROUP1
direction: upstream
ip_address: 10.10.101.3/31
- name: Ethernet10
Expand Down Expand Up @@ -436,7 +437,8 @@ port_channel_interfaces:
description: server01_ES1_PortChanne1
shutdown: false
link_tracking_groups:
- name: LT_GROUP1
names:
- LT_GROUP1
direction: downstream
switchport:
enabled: true
Expand All @@ -450,7 +452,8 @@ port_channel_interfaces:
description: server03_AUTO_ESI_Auto-ESI PortChannel
shutdown: false
link_tracking_groups:
- name: LT_GROUP1
names:
- LT_GROUP1
direction: downstream
switchport:
enabled: true
Expand All @@ -464,7 +467,8 @@ port_channel_interfaces:
description: server04_AUTO_ESI_Profile_Auto-ESI PortChannel from profile
shutdown: false
link_tracking_groups:
- name: LT_GROUP1
names:
- LT_GROUP1
direction: downstream
switchport:
enabled: true
Expand All @@ -478,7 +482,8 @@ port_channel_interfaces:
description: server05_AUTO_ESI_Profile_Override_Auto-ESI PortChannel overridden on server
shutdown: false
link_tracking_groups:
- name: LT_GROUP1
names:
- LT_GROUP1
direction: downstream
switchport:
enabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ ethernet_interfaces:
switchport:
enabled: false
link_tracking_groups:
- name: Eth-conn-to-router
names:
- Eth-conn-to-router
direction: upstream
ip_address: 10.10.101.5/31
- name: Ethernet2
Expand All @@ -231,7 +232,8 @@ ethernet_interfaces:
mode: access
access_vlan: '310'
link_tracking_groups:
- name: Eth-conn-to-router
names:
- Eth-conn-to-router
direction: downstream
port_channel_interfaces:
- name: Port-Channel2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ ethernet_interfaces:
phone:
vlan: 321
link_tracking_groups:
- name: LT_GROUP1
names:
- LT_GROUP1
direction: downstream
- name: Ethernet16
peer: INDIVIDUAL_2_TRUNK_PHONE
Expand All @@ -254,7 +255,8 @@ ethernet_interfaces:
phone:
vlan: 321
link_tracking_groups:
- name: LT_GROUP1
names:
- LT_GROUP1
direction: downstream
port_channel_interfaces:
- name: Port-Channel1
Expand Down
11 changes: 9 additions & 2 deletions python-avd/pyavd/_eos_designs/eos_designs_facts/uplinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ def _get_p2p_uplink(self: EosDesignsFacts, uplink_index: int, uplink_interface:
uplink["peer_ip_address"] = self.shared_utils.ip_addressing.p2p_uplinks_peer_ip(uplink_index)

if self.shared_utils.link_tracking_groups is not None:
uplink["link_tracking_groups"] = [{"name": lt_group["name"], "direction": "upstream"} for lt_group in self.shared_utils.link_tracking_groups]
uplink["link_tracking_groups"] = {
"names": [lt_group["name"] for lt_group in self.shared_utils.link_tracking_groups],
"direction": "upstream",
}

if self.shared_utils.uplink_structured_config is not None:
uplink["structured_config"] = self.shared_utils.uplink_structured_config

Expand Down Expand Up @@ -291,7 +295,10 @@ def _get_l2_uplink(
uplink["peer_short_esi"] = self._short_esi

if self.shared_utils.link_tracking_groups is not None:
uplink["link_tracking_groups"] = [{"name": lt_group["name"], "direction": "upstream"} for lt_group in self.shared_utils.link_tracking_groups]
uplink["link_tracking_groups"] = {
"names": [lt_group["name"] for lt_group in self.shared_utils.link_tracking_groups],
"direction": "upstream",
}

if not self.shared_utils.network_services_l2:
# This child device does not support VLANs, so we tell the peer to enable portfast
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,10 @@ def _get_adapter_link_tracking_groups(self: AvdStructuredConfigConnectedEndpoint
if self.shared_utils.link_tracking_groups is None or get(adapter, "link_tracking.enabled") is not True:
return None

return [
{
"name": get(adapter, "link_tracking.name", default=self.shared_utils.link_tracking_groups[0]["name"]),
"direction": "downstream",
},
]
return {
"names": [get(adapter, "link_tracking.name", default=self.shared_utils.link_tracking_groups[0]["name"])],
"direction": "downstream",
}

def _get_adapter_ptp(self: AvdStructuredConfigConnectedEndpoints, adapter: dict) -> dict | None:
"""Return ptp for one adapter."""
Expand Down

0 comments on commit a3d5cbf

Please sign in to comment.