-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat(eos_cli_config_gen): Adding new improved model for interface link tracking groups #4610
base: devel
Are you sure you want to change the base?
Conversation
Review docs on Read the Docs To test this pull request: # Create virtual environment for this testing below the current directory
python -m venv test-avd-pr-4610
# Activate the virtual environment
source test-avd-pr-4610/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/Vibhu-gslab/avd.git@4584#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/Vibhu-gslab/avd.git#/ansible_collections/arista/avd/,4584 --force
# Optional: Install AVD examples
cd test-avd-pr-4610
ansible-playbook arista.avd.install_examples |
python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/ethernet_interfaces.schema.yml
Outdated
Show resolved
Hide resolved
link_tracking_groups: | ||
- name: EVPN_MH_ES1 | ||
direction: upstream | ||
direction: upstream | ||
names: [EVPN_MH_ES1, EVPN_MH_ES2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a breaking change which cannot get merged until 6.0.0. Instead I think we could do:
link_tracking:
direction: upstream
groups: [EVPN_MH_ES1, EVPN_MH_ES2]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added!
python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/port_channel_interfaces.schema.yml
Outdated
Show resolved
Hide resolved
python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/ethernet_interfaces.schema.yml
Outdated
Show resolved
Hide resolved
python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/port-channel-interfaces.j2
Show resolved
Hide resolved
python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/port-channel-interfaces.j2
Outdated
Show resolved
Hide resolved
@@ -334,6 +334,11 @@ | |||
| {{ link_tracking_interface.name }} | {{ link_tracking_group.name }} | {{ link_tracking_group.direction }} | | |||
{% endif %} | |||
{% endfor %} | |||
{% if link_tracking_interface.link_tracking.direction is arista.avd.defined %} | |||
{% for group_name in link_tracking_interface.link_tracking.groups | arista.avd.natural_sort %} | |||
| {{ link_tracking_interface.name }} | {{ group_name }} | {{ link_tracking_interface.link_tracking.direction }} | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think in new model we should join all group by comma and keep in one row only.
cc: @ClausHolbechArista
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed!
python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/port_channel_interfaces.schema.yml
Outdated
Show resolved
Hide resolved
7931de7
to
8dcaeba
Compare
e8a709a
to
389a713
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
{% for group_name in link_tracking_interface.link_tracking.groups %} | ||
{% do link_tracking_group_name.append(group_name) %} | ||
| {{ link_tracking_interface.name }} | {{ link_tracking_group_name | join(', ') }} | {{ link_tracking_interface.link_tracking.direction }} | | ||
{% endfor %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{% for group_name in link_tracking_interface.link_tracking.groups %} | |
{% do link_tracking_group_name.append(group_name) %} | |
| {{ link_tracking_interface.name }} | {{ link_tracking_group_name | join(', ') }} | {{ link_tracking_interface.link_tracking.direction }} | | |
{% endfor %} | |
| {{ link_tracking_interface.name }} | {{ link_tracking_interface.link_tracking.groups | join(', ') }} | {{ link_tracking_interface.link_tracking.direction }} | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
{% 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.direction is arista.avd.defined %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{% if link_tracking_interface.link_tracking.direction is arista.avd.defined %} | |
{% if link_tracking_interface.link_tracking.direction is arista.avd.defined and link_tracking_interface.link_tracking.group is arista.avd.defined %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
{% if link_tracking_interface.link_tracking.direction is arista.avd.defined %} | ||
{% for group_name in link_tracking_interface.link_tracking.groups | arista.avd.natural_sort('name') %} | ||
{% do link_tracking_group_name.append(group_name) %} | ||
| {{ link_tracking_interface.name }} | {{ link_tracking_group_name | join(', ') }} | {{ link_tracking_interface.link_tracking.direction }} | | ||
{% endfor %} | ||
{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{% if link_tracking_interface.link_tracking.direction is arista.avd.defined %} | |
{% for group_name in link_tracking_interface.link_tracking.groups | arista.avd.natural_sort('name') %} | |
{% do link_tracking_group_name.append(group_name) %} | |
| {{ link_tracking_interface.name }} | {{ link_tracking_group_name | join(', ') }} | {{ link_tracking_interface.link_tracking.direction }} | | |
{% endfor %} | |
{% endif %} | |
{% if link_tracking_interface.link_tracking.direction is arista.avd.defined and link_tracking_interface.link_tracking.groups is arista.avd.defined %} | |
| {{ link_tracking_interface.name }} | {{ link_tracking_interface.link_tracking.groups | join(', ') }} | {{ link_tracking_interface.link_tracking.direction }} | | |
{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
| Ethernet1 | EVPN_MH_ES3 | upstream | | ||
| Ethernet1 | EVPN_MH_ES3, EVPN_MH_ES4 | upstream | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can see duplicate entries here...
…irection in link tracking group for the same interface
Quality Gate passedIssues Measures |
Change Summary
Introducing new model for link tracking group which supports only one direction for an interface
Related Issue(s)
Fixes #4584
Component(s) name
arista.avd.eos_cli_config_gen
Proposed changes
Adding a new model
How to test
Checklist
Repository Checklist