Refactor(eos_designs): Refactor the method of route map RM-CONN-2-BGP generation#6779
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-6779
# Activate the virtual environment
source test-avd-pr-6779/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/laxmikantchintakindi/avd.git@refactor/rm-conn-bgp#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
python -m ansible.cli.galaxy collection install git+https://github.com/laxmikantchintakindi/avd.git#/ansible_collections/arista/avd/,refactor/rm-conn-bgp --force
cd test-avd-pr-6779
# Run your playbook using `python -m ansible.cli.playbook path/to/playbook.yml ...`You can also test this PR using AVD playground:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #6779 +/- ##
==========================================
- Coverage 87.36% 87.33% -0.03%
==========================================
Files 351 350 -1
Lines 19358 19314 -44
Branches 3619 3612 -7
==========================================
- Hits 16912 16868 -44
Misses 1884 1884
Partials 562 562
🚀 New features to boost your workflow:
|
RM-CONN-2-BGP generation
| @@ -1,92 +0,0 @@ | |||
| # Copyright (c) 2023-2026 Arista Networks, Inc. | |||
There was a problem hiding this comment.
I think we should not remove the mixin completely for prefix_lists
There was a problem hiding this comment.
As all the methods are moved, removed this file.
|
|
||
| self.structured_config.prefix_lists.append_new(name="PL-LOOPBACKS-EVPN-OVERLAY", sequence_numbers=sequence_numbers) | ||
|
|
||
| def set_once_prefix_list_loopbacks_pim_rp(self: StructuredConfigUtils) -> None: |
There was a problem hiding this comment.
missed to add @run_once_method decorator?
There was a problem hiding this comment.
all these prefix_lists methods are called for underlay route-maps only, so we should not move them to structured_config_utils, its better to keep them as they are in the mixin
There was a problem hiding this comment.
Yes but the main method to set the route map RM-CONN-2BGP is called from inband_management and underlay. So moved the methods here. Methods like set_once_prefix_list_loopbacks_pim_rp which are not run_once_methods are called from run_once_method. So without the decorator too they will be called once.
There was a problem hiding this comment.
This way the structured_config_utils would become very large
|



Change Summary
Refactor the logic for route map RM-CONN-2_BGP generation. Removed some structured_config_contributors from inband_mgmt/init and moved the logic for generating the route map to structured_config_utils.py.
Also generation of RM-CONN-2-BGP route map in network services is now handled in structured_config_utils.
Related Issue(s)
Fixes #
Component(s) name
arista.avd.eos_designsProposed changes
How to test
Checklist
User Checklist
Repository Checklist