Skip to content
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

Fix(eos_designs): Connected endpoints ESI should only be configured on EVPN VTEPs. #4020

Merged
merged 4 commits into from
May 22, 2024

Conversation

laxmikantchintakindi
Copy link
Contributor

@laxmikantchintakindi laxmikantchintakindi commented May 21, 2024

Change Summary

Connected endpoints ESI should only matter for EVPN VTEPs. It is not needed to configure short_esi on l2leafs.

Related Issue(s)

Fixes #3064

Component(s) name

arista.avd.eos_designs

Proposed changes

Change python module to skip generating short_esi for l2leafs.

How to test

Add short_esi under l2leaf and make sure it is not generated in structured config.

Checklist

User Checklist

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

@github-actions github-actions bot added the role: eos_designs issue related to eos_designs role label May 21, 2024
Copy link

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-4020
# Activate the virtual environment
source test-avd-pr-4020/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/laxmikantchintakindi/avd.git@esi#subdirectory=python-avd" --force
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/laxmikantchintakindi/avd.git#/ansible_collections/arista/avd/,esi --force
# Optional: Install AVD examples
cd test-avd-pr-4020
ansible-playbook arista.avd.install_examples

@@ -104,8 +104,11 @@ def _get_short_esi(self, adapter: dict, channel_group_id: int, short_esi: str =
# short_esi is only set when called from sub-interface port-channels.
if short_esi is None:
# Setting short_esi under port_channel will be removed in AVD5.0
port_channel_short_esi = get(adapter, "port_channel.short_esi")
if (short_esi := get(adapter, "ethernet_segment.short_esi", default=port_channel_short_esi)) is None:
if self._hostvars["type"] != "l2leaf":
Copy link
Contributor

@ClausHolbechArista ClausHolbechArista May 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not how we should check for it. Types are customizable, so we have to check for capabilities instead. I suggest checking this:

Suggested change
if self._hostvars["type"] != "l2leaf":
if self.shared_utils.overlay_evpn and self.shared_utils.overlay_vtep:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this will not capture all cases, since you add it below the short_esi is none check. Please move these two conditions (negated) to the if in line 100. So we return None if these two are NOT true.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. It should also be for evpn-mpls so I will update my comment above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if self.shared_utils.overlay_evpn and self.shared_utils.overlay_vtep:

can we write 'or' instead of 'and'?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can implement it any way you like. Just make sure you understand the logic and how it would work first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@ClausHolbechArista ClausHolbechArista changed the title Fix(eos_designs): Connected endpoints ESI should only matter for EVPN VTEPs. Fix(eos_designs): Connected endpoints ESI should only be configured on EVPN VTEPs. May 21, 2024
@laxmikantchintakindi laxmikantchintakindi marked this pull request as ready for review May 21, 2024 10:24
@laxmikantchintakindi laxmikantchintakindi requested review from a team as code owners May 21, 2024 10:24
@laxmikantchintakindi laxmikantchintakindi marked this pull request as draft May 21, 2024 10:30
@github-actions github-actions bot added the state: CI Updated CI scenario have been updated in the PR label May 21, 2024
@laxmikantchintakindi laxmikantchintakindi marked this pull request as ready for review May 21, 2024 13:46
@ClausHolbechArista ClausHolbechArista added the one approval This PR has one approval and is only missing one more. label May 21, 2024
@ClausHolbechArista ClausHolbechArista requested a review from a team May 21, 2024 13:54
Copy link

sonarcloud bot commented May 22, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@ClausHolbechArista ClausHolbechArista merged commit b4d5caf into aristanetworks:devel May 22, 2024
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
one approval This PR has one approval and is only missing one more. rn: Fix(eos_designs) role: eos_designs issue related to eos_designs role state: CI Updated CI scenario have been updated in the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eos_designs: Connected endpoints ESI should only matter for EVPN VTEPs.
3 participants