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

Fix(eos_designs): core_interfaces generates invalid config if ASN is not defined for the p2p_links/p2p_links_profiles #4046

Conversation

Shivani-gslab
Copy link
Contributor

@Shivani-gslab Shivani-gslab commented May 28, 2024

Change Summary

Current code is converting the bgp_as value to string, where None value is also getting converted to type string, which is revoking the check for None value to raise the AristaAvdMissingVariableError even if core_interfaces.p2p_links.[].as is not defined.

Fixing the code and tests for the same.

Related Issue(s)

Fixes #3596

Component(s) name

arista.avd.eos_designs

Proposed changes

Fixing the type conversion in ansible_collections/arista/avd/roles/eos_designs/python_modules/core_interfaces_and_l3_edge/utils.py

How to test

Test by not defining core_interfaces.p2p_links.[].as in input and run the eos_designs role. AristaAvdMissingVariableError is expected.

Check the test added in eos_designs_negative_unit_tests molecule scenario.

Checklist

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

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-4046
# Activate the virtual environment
source test-avd-pr-4046/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/Shivani-gslab/avd.git@core_interfaces_p2p_links_as#subdirectory=python-avd" --force
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/Shivani-gslab/avd.git#/ansible_collections/arista/avd/,core_interfaces_p2p_links_as --force
# Optional: Install AVD examples
cd test-avd-pr-4046
ansible-playbook arista.avd.install_examples

@github-actions github-actions bot added state: CI Updated CI scenario have been updated in the PR role: eos_designs issue related to eos_designs role labels May 28, 2024
@MaheshGSLAB MaheshGSLAB marked this pull request as ready for review May 31, 2024 10:23
@MaheshGSLAB MaheshGSLAB requested review from a team as code owners May 31, 2024 10:23
@carlbuchmann carlbuchmann added the type: bug Something isn't working label May 31, 2024
@github-actions github-actions bot added the type: code quality CI and development toolset label Jun 4, 2024
Copy link

sonarcloud bot commented Jun 4, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@ClausHolbechArista ClausHolbechArista merged commit 872f3a3 into aristanetworks:devel Jun 4, 2024
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn: Fix(eos_designs) role: eos_designs issue related to eos_designs role state: CI Updated CI scenario have been updated in the PR type: bug Something isn't working type: code quality CI and development toolset
Projects
None yet
Development

Successfully merging this pull request may close these issues.

core_interfaces can generate invalid config if BGP AS is not defined
5 participants