Skip to content

Commit

Permalink
Refactore(eos_cli_config_gen): Change the model to support only one d…
Browse files Browse the repository at this point in the history
…irection in link tracking group for the same interface
  • Loading branch information
Vibhu-gslab committed Oct 17, 2024
1 parent 40451d8 commit 3555b48
Show file tree
Hide file tree
Showing 17 changed files with 88 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ sFlow is disabled.
| Interface | Group Name | Direction |
| --------- | ---------- | --------- |
| Ethernet1 | EVPN_MH_ES1 | upstream |
| Ethernet1 | EVPN_MH_ES2 | upstream |
| Ethernet3 | EVPN_MH_ES2 | downstream |

##### Phone Interfaces
Expand Down Expand Up @@ -445,6 +446,7 @@ interface Ethernet1
switchport backup initial-mac-move-delay 10
switchport backup dest-macaddr 01:00:00:00:00:00
link tracking group EVPN_MH_ES1 upstream
link tracking group EVPN_MH_ES2 upstream
comment
Comment created from eos_cli under ethernet_interfaces.Ethernet1
EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ interface Ethernet1
switchport backup initial-mac-move-delay 10
switchport backup dest-macaddr 01:00:00:00:00:00
link tracking group EVPN_MH_ES1 upstream
link tracking group EVPN_MH_ES2 upstream
comment
Comment created from eos_cli under ethernet_interfaces.Ethernet1
EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ ethernet_interfaces:
l2_mru: 8000
ip_address: 172.31.255.1/31
link_tracking_groups:
- name: EVPN_MH_ES1
direction: upstream
direction: upstream
names: [EVPN_MH_ES1, EVPN_MH_ES2]
priority_flow_control:
enabled: true
priorities:
Expand Down Expand Up @@ -196,8 +196,8 @@ ethernet_interfaces:
ip_address: 172.31.128.1/31
snmp_trap_link_change: false
link_tracking_groups:
- name: EVPN_MH_ES2
direction: downstream
direction: downstream
names: [EVPN_MH_ES2]
ipv6_enable: true
ipv6_address: 2002:ABDC::1/64
ipv6_nd_prefixes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ port_channel_interfaces:
- name: Port-Channel5
description: DC1_L2LEAF1_Po1
link_tracking_groups:
- name: EVPN_MH_ES1
direction: downstream
direction: downstream
names: [EVPN_MH_ES1]
switchport:
enabled: true
mode: trunk
Expand Down Expand Up @@ -56,8 +56,8 @@ port_channel_interfaces:
- name: Port-Channel15
description: DC1_L2LEAF3_Po1
link_tracking_groups:
- name: EVPN_MH_ES2
direction: upstream
direction: upstream
names: [EVPN_MH_ES2]
switchport:
enabled: true
mode: trunk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ interface Port-Channel10
switchport trunk allowed vlan 110-111,210-211
switchport mode trunk
switchport
!
evpn ethernet-segment
identifier 0000:0000:0303:0202:0101
route-target import 03:03:02:02:01:01
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ interface Port-Channel10
switchport trunk allowed vlan 110-111,210-211
switchport mode trunk
switchport
!
evpn ethernet-segment
identifier 0000:0000:0303:0202:0101
route-target import 03:03:02:02:01:01
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ cvp_configlets:
trunk allowed vlan 110-111,120-121,130-131,140-141,150,210-211,250,310-311,350\n
\ switchport mode trunk\n switchport\n mlag 7\n!\ninterface Port-Channel10\n
\ description SERVER_server03_ESI\n no shutdown\n switchport trunk allowed
vlan 110-111,210-211\n switchport mode trunk\n switchport\n evpn ethernet-segment\n
vlan 110-111,210-211\n switchport mode trunk\n switchport\n !\n evpn ethernet-segment\n
\ identifier 0000:0000:0303:0202:0101\n route-target import 03:03:02:02:01:01\n
\ lacp system-id 0303.0202.0101\n!\ninterface Ethernet1\n description P2P_DC1-SPINE1_Ethernet4\n
\ no shutdown\n mtu 1500\n no switchport\n ip address 172.31.255.25/31\n!\ninterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ cvp_configlets:
trunk allowed vlan 110-111,120-121,130-131,140-141,150,210-211,250,310-311,350\n
\ switchport mode trunk\n switchport\n mlag 7\n!\ninterface Port-Channel10\n
\ description SERVER_server03_ESI\n no shutdown\n switchport trunk allowed
vlan 110-111,210-211\n switchport mode trunk\n switchport\n evpn ethernet-segment\n
vlan 110-111,210-211\n switchport mode trunk\n switchport\n !\n evpn ethernet-segment\n
\ identifier 0000:0000:0303:0202:0101\n route-target import 03:03:02:02:01:01\n
\ lacp system-id 0303.0202.0101\n!\ninterface Ethernet1\n description P2P_DC1-SPINE1_Ethernet4\n
\ no shutdown\n mtu 1500\n no switchport\n ip address 172.31.255.25/31\n!\ninterface
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@
| Interface | Group Name | Direction |
| --------- | ---------- | --------- |
{% for link_tracking_interface in link_tracking_interfaces %}
{% for link_tracking_group in link_tracking_interface.link_tracking_groups | arista.avd.natural_sort('name') %}
{% if link_tracking_group.name is arista.avd.defined and link_tracking_group.direction is arista.avd.defined %}
| {{ link_tracking_interface.name }} | {{ link_tracking_group.name }} | {{ link_tracking_group.direction }} |
{% endif %}
{% endfor %}
{% if link_tracking_interface.link_tracking_groups.direction is arista.avd.defined %}
{% for name in link_tracking_interface.link_tracking_groups.names | arista.avd.natural_sort %}
| {{ link_tracking_interface.name }} | {{ name }} | {{ link_tracking_interface.link_tracking_groups.direction }} |
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{# Phone Interfaces #}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,12 @@

| Interface | Group Name | Direction |
| --------- | ---------- | --------- |
{% for link_tracking_interface in link_tracking_interfaces | arista.avd.natural_sort('name') %}
{% for link_tracking_group in link_tracking_interface.link_tracking_groups | arista.avd.natural_sort('name') %}
{% if link_tracking_group.name is arista.avd.defined and link_tracking_group.direction is arista.avd.defined %}
| {{ link_tracking_interface.name }} | {{ link_tracking_group.name }} | {{ link_tracking_group.direction }} |
{% endif %}
{% endfor %}
{% for link_tracking_interface in link_tracking_interfaces %}
{% if link_tracking_interface.link_tracking_groups.direction is arista.avd.defined %}
{% for name in link_tracking_interface.link_tracking_groups.names | arista.avd.natural_sort %}
| {{ link_tracking_interface.name }} | {{ name }} | {{ link_tracking_interface.link_tracking_groups.direction }} |
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{# IPv4 #}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -899,11 +899,11 @@ interface {{ ethernet_interface.name }}
priority {{ ethernet_interface.sync_e.priority }}
{% endif %}
{% endif %}
{% for link_tracking_group in ethernet_interface.link_tracking_groups | arista.avd.natural_sort %}
{% if link_tracking_group.name is arista.avd.defined and link_tracking_group.direction is arista.avd.defined %}
link tracking group {{ link_tracking_group.name }} {{ link_tracking_group.direction }}
{% endif %}
{% endfor %}
{% if ethernet_interface.link_tracking_groups.direction is arista.avd.defined %}
{% for name in ethernet_interface.link_tracking_groups.names | arista.avd.natural_sort %}
link tracking group {{ name }} {{ ethernet_interface.link_tracking_groups.direction }}
{% endfor %}
{% endif %}
{% if ethernet_interface.vmtracer is arista.avd.defined(true) %}
vmtracer vmware-esx
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,11 +718,11 @@ interface {{ port_channel_interface.name }}
switchport backup dest-macaddr {{ port_channel_interface.switchport.backup.dest_macaddr }}
{% endif %}
{% endif %}
{% for link_tracking_group in port_channel_interface.link_tracking_groups | arista.avd.natural_sort('name') %}
{% if link_tracking_group.name is arista.avd.defined and link_tracking_group.direction is arista.avd.defined %}
link tracking group {{ link_tracking_group.name }} {{ link_tracking_group.direction }}
{% endif %}
{% endfor %}
{% if port_channel_interface.link_tracking_groups.direction is arista.avd.defined %}
{% for name in port_channel_interface.link_tracking_groups.names | arista.avd.natural_sort %}
link tracking group {{ name }} {{ port_channel_interface.link_tracking_groups.direction }}
{% endfor %}
{% endif %}
{% if port_channel_interface.vmtracer is arista.avd.defined(true) %}
vmtracer vmware-esx
{% endif %}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,15 @@ keys:
reed_solomon:
type: bool
link_tracking_groups:
type: list
primary_key: name
items:
type: dict
keys:
name:
type: str
description: Group name.
direction:
type: str
valid_values: ["upstream", "downstream"]
type: dict
keys:
direction:
type: str
valid_values: ["upstream", "downstream"]
names:
type: list
description: Group names.
min_length: 1
evpn_ethernet_segment:
type: dict
keys:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,19 +306,15 @@ keys:
remove_in_version: 6.0.0
new_key: switchport.trunk.native_vlan_tag
link_tracking_groups:
type: list
primary_key: name
items:
type: dict
keys:
name:
type: str
description: Group name.
direction:
type: str
valid_values:
- upstream
- downstream
type: dict
keys:
direction:
type: str
valid_values: ["upstream", "downstream"]
names:
type: list
description: Group names.
min_length: 1
phone:
type: dict
deprecation:
Expand Down

0 comments on commit 3555b48

Please sign in to comment.