aristanetworks / avd

Arista Validated Designs
https://avd.arista.com
Apache License 2.0
299 stars 219 forks source link

Fix(eos_designs): Always output interface access_vlan as int in structured_config #4738

Closed ClausHolbechArista closed 1 week ago

ClausHolbechArista commented 1 week ago

Change Summary

Always output interface access_vlan as int in structured_config

Related Issue(s)

Recent changes caused switchport.access_vlan to be written as a string in the outputs of eos_designs. This did not have an impact on most users, since validation in eos_cli_config_gen automatically converted the values. For some users using PyAVD without running validation, the string values triggered template errors in get_device_doc which were very hard to decipher.

Component(s) name

arista.avd.eos_designs

Proposed changes

How to test

Added negative testing. Reran all molecule since structured config has changed.

Checklist

User Checklist

Repository Checklist

github-actions[bot] commented 1 week ago

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-4738
# Activate the virtual environment
source test-avd-pr-4738/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/ClausHolbechArista/avd.git@fix/eos_designs/output-access_vlan-as-int#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/ClausHolbechArista/avd.git#/ansible_collections/arista/avd/,fix/eos_designs/output-access_vlan-as-int --force
# Optional: Install AVD examples
cd test-avd-pr-4738
ansible-playbook arista.avd.install_examples
sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud