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

Refactor(eos_designs): Refactor structured_config code for underlay/as.py #4978

Draft
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

laxmikantchintakindi
Copy link
Contributor

@laxmikantchintakindi laxmikantchintakindi commented Feb 5, 2025

Change Summary

Refactor structured_config code for underlay/as.py

Related Issue(s)

Fixes #

Component(s) name

arista.avd.eos_designs

Proposed changes

Refactor structured_config code for underlay/as.py

How to test

Checklist

User Checklist

  • N/A

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)

Copy link

github-actions bot commented Feb 5, 2025

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-4978
# Activate the virtual environment
source test-avd-pr-4978/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/laxmikantchintakindi/avd.git@refactor/underlay/as-path#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/laxmikantchintakindi/avd.git#/ansible_collections/arista/avd/,refactor/underlay/as-path --force
# Optional: Install AVD examples
cd test-avd-pr-4978
ansible-playbook arista.avd.install_examples

@laxmikantchintakindi laxmikantchintakindi force-pushed the refactor/underlay/as-path branch 2 times, most recently from 2bb5a0c to f6772a0 Compare February 5, 2025 08:23
Comment on lines 29 to 35
access_lists = EosCliConfigGen.AsPath.AccessLists()
entries = EosCliConfigGen.AsPath.AccessListsItem.Entries()
entries.append_new(type="permit", match=self.shared_utils.bgp_as)
access_lists.append_new(name="ASPATH-WAN", entries=entries)

if access_lists:
self.structured_config.as_path._update(access_lists=access_lists)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
access_lists = EosCliConfigGen.AsPath.AccessLists()
entries = EosCliConfigGen.AsPath.AccessListsItem.Entries()
entries.append_new(type="permit", match=self.shared_utils.bgp_as)
access_lists.append_new(name="ASPATH-WAN", entries=entries)
if access_lists:
self.structured_config.as_path._update(access_lists=access_lists)
entries = EosCliConfigGen.AsPath.AccessListsItem.Entries()
entries.append_new(type="permit", match=self.shared_utils.bgp_as)
access_lists = EosCliConfigGen.AsPath.AccessListsItem(name="ASPATH-WAN", entries=entries)
self.structured_config.as_path.access_lists.append(access_lists)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

Copy link

sonarqubecloud bot commented Feb 6, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants