Feat(eos_cli_config_gen): Adding new keys for inner_vlan_mask and inner_vlan_number under ip_access_lists#6776
Conversation
…er_vlan_number under ip_access_lists
|
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-6776
# Activate the virtual environment
source test-avd-pr-6776/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/Shivani-gslab/avd.git@inner_vlan_ip_access_lists#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/Shivani-gslab/avd.git#/ansible_collections/arista/avd/,inner_vlan_ip_access_lists --force
cd test-avd-pr-6776
# Run your playbook using `python -m ansible.cli.playbook path/to/playbook.yml ...`You can also test this PR using AVD playground:
|
...a/avd/extensions/molecule/eos_cli_config_gen/inventory/host_vars/host1/ipv6-access-lists.yml
Show resolved
Hide resolved
python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/ip_access_lists.schema.yml
Show resolved
Hide resolved
| # TTL value. | ||
| ttl: <int; 0-255> | ||
| ttl_match: <str; "eq" | "gt" | "lt" | "neq"; default="eq"> | ||
| # This key is deprecated. |
There was a problem hiding this comment.
The key deprecated from eos_designs as well so we need to update the code
There was a problem hiding this comment.
there is no specific code for this in eos_designs, it is reading the ipv4_acls and casting it to eos_cli_config_gen
if acl_name in self.inputs.ipv4_acls:
# pass substitution fields as anything to check if acl requires substitution or not
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
self.structured_config.ip_access_lists.append(acl._cast_as(EosCliConfigGen.IpAccessListsItem))
return
There were no tests for this key, I have added the test for this
There was a problem hiding this comment.
can you check by keeping both keys in a tests and how it behaves
There was a problem hiding this comment.
yes I tried that, if we give both it generates both the keys in structured config (since we are directly using cast_as on the ipv4_acl element) but no diffs in config.
@ClausHolbechArista I would like to confirm, if its okay to keep like this? or we should refactor the code to have conditions to generate any one of these keys in structured_config?
- name: TEST-IPV4-ACL-WITH-IP-FIELDS-OUT_Ethernet2
protocol: ip
source: 172.20.20.1/30
destination: 172.20.20.0
+ vlan_inner: true
inner_vlan_number: 123
inner_vlan_mask: '0x000'
There was a problem hiding this comment.
why is the deprecation not blocking this with a conflict? I am not saying we should do anything in eos_designs logic but I would expect the schema to catch this.
There was a problem hiding this comment.
I tried giving the single key in new_key still its passing with no error
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devel #6776 +/- ##
=======================================
Coverage 87.36% 87.36%
=======================================
Files 351 351
Lines 19358 19358
Branches 3619 3619
=======================================
Hits 16912 16912
Misses 1884 1884
Partials 562 562 🚀 New features to boost your workflow:
|
bc2338f to
bf60a74
Compare
| ip access-list TEST-IPV4-ACL-WITH-IP-FIELDS-IN_Ethernet5_1 | ||
| 15 deny ip any host 172.20.20.0 | ||
| permit ip 172.20.20.1/30 host 172.20.20.0 | ||
| permit vlan inner 123 0x000 ip 172.20.20.1/30 host 172.20.20.0 |
There was a problem hiding this comment.
Can you have vlan inner xxx and vlan xxx at the same time? If not I think the old boolean worked fine to just add the inner keyword before the vlan and mask.
There was a problem hiding this comment.
|
e95004f to
4724e0c
Compare



Change Summary
Adding new keys for inner_vlan_mask and inner_vlan_number under ip_access_lists
Related Issue(s)
Fixes #6749
Component(s) name
arista.avd.eos_cli_config_genProposed changes
inner_vlan_maskandinner_vlan_numbervlan_innerkeyHow to test
Molecule tests added
Checklist
User Checklist
Repository Checklist