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): Avoid returning objects in facts #5016

Conversation

ClausHolbechArista
Copy link
Contributor

Change Summary

Fix(eos_designs): Avoid returning objects in facts

Related Issue(s)

Fixes #5014

Component(s) name

arista.avd.eos_designs

Proposed changes

  • Fix a couple of facts that sometimes returned a schema object instead of the native types.

How to test

  • Added pytest coverage to ensure the returned objects are JSON serializable, so this will not happen again.
    • Saw the issue before applying the fix.

Checklist

User Checklist

  • N/A

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)

@ClausHolbechArista ClausHolbechArista requested review from a team as code owners February 12, 2025 06:34
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-5016
# Activate the virtual environment
source test-avd-pr-5016/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/ClausHolbechArista/avd.git@fix/eos_designs/objects-returned-in-facts#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/objects-returned-in-facts --force
# Optional: Install AVD examples
cd test-avd-pr-5016
ansible-playbook arista.avd.install_examples

@ClausHolbechArista ClausHolbechArista added the type: bug Something isn't working label Feb 12, 2025
@ClausHolbechArista ClausHolbechArista added this to the v.5.2.1 milestone Feb 12, 2025
@gmuloc gmuloc requested a review from a team February 12, 2025 10:19
@gmuloc gmuloc added the one approval This PR has one approval and is only missing one more. label Feb 12, 2025
Copy link
Member

@carlbuchmann carlbuchmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@carlbuchmann carlbuchmann merged commit 607c13e into aristanetworks:devel Feb 12, 2025
44 checks passed
ClausHolbechArista added a commit to ClausHolbechArista/avd that referenced this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
one approval This PR has one approval and is only missing one more. rn: Fix(eos_designs) type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: Object of type EvpnRouteServers is not JSON serializable
3 participants