-
Notifications
You must be signed in to change notification settings - Fork 239
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 eos_designs structured_config code ip_access_list #4972
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-4972
# Activate the virtual environment
source test-avd-pr-4972/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/MaheshGSLAB/ansible-avd.git@ip-access-list#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/MaheshGSLAB/ansible-avd.git#/ansible_collections/arista/avd/,ip-access-list --force
# Optional: Install AVD examples
cd test-avd-pr-4972
ansible-playbook arista.avd.install_examples |
for more information, see https://pre-commit.ci
python-avd/pyavd/_eos_designs/structured_config/underlay/ip_access_lists.py
Outdated
Show resolved
Hide resolved
python-avd/pyavd/_eos_designs/structured_config/network_services/vlan_interfaces.py
Outdated
Show resolved
Hide resolved
python-avd/pyavd/_eos_designs/structured_config/underlay/utils.py
Outdated
Show resolved
Hide resolved
python-avd/pyavd/_eos_designs/structured_config/underlay/utils.py
Outdated
Show resolved
Hide resolved
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
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
Conflicts have been resolved. A maintainer will review the pull request shortly. |
|
||
return natural_sort(ip_access_lists, "name") or None | ||
self.structured_config.ip_access_lists = EosCliConfigGen.IpAccessLists(natural_sort(self.structured_config.ip_access_lists, sort_key="name")) |
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.
Please don't do this. Reading back structured config and reordering it will be very inefficient. It is ok if we reorder structured config a bit as long as the eos config and docs are the same.
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.
removed
- source: any | ||
destination: 100.64.30.2 | ||
sequence: 10 | ||
action: permit | ||
protocol: udp |
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.
Something is wrong with this reordering. We The order of these outputs are controlled by the order of the fields in the classes, so we should not see this, if we output the correct class. Can you check that you don't have any type errors that could explain this?
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.
updated as you suggested(reference from underlay port-channel refactoring)
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
elif internet_exit_policy_type == "direct": | ||
self._acl_internet_exit_direct() | ||
|
||
@structured_config_contributor |
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.
Please move this method to the top
@@ -86,41 +63,33 @@ def _acl_internet_exit_user_defined( | |||
acl = self.shared_utils.get_ipv4_acl(acl_name, "random", interface_ip="random", peer_ip="random") | |||
if acl.name == acl_name: | |||
# ACL doesn't need replacement | |||
return [acl._as_dict()] | |||
return acl |
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.
There is a type error
return acl | |
return acl._cast_as(EosCliConfigGen.IpAccessListsItem) |
Update the return type in line 54 as well
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, this change fixes the ordering as well.
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.
updated
|
Change Summary
Refactor eos_designs structured_config code ip_access_list
Related Issue(s)
Fixes #
Component(s) name
arista.avd.eos_designs
Proposed changes
Refactor eos_designs structured_config code ip_access_list
How to test
Run Molecule
Checklist
User Checklist
Repository Checklist