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

Refactor: Better error messages for missing keys #4541

Open
wants to merge 7 commits into
base: devel
Choose a base branch
from

Conversation

gmuloc
Copy link
Contributor

@gmuloc gmuloc commented Oct 2, 2024

Change Summary

Related Issue(s)

Fixes #

Component(s) name

arista.avd.<role-name>

Proposed changes

How to test

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)

Copy link

github-actions bot commented Oct 2, 2024

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-4541
# Activate the virtual environment
source test-avd-pr-4541/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/gmuloc/avd.git@refactor-error-handling#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/gmuloc/avd.git#/ansible_collections/arista/avd/,refactor-error-handling --force
# Optional: Install AVD examples
cd test-avd-pr-4541
ansible-playbook arista.avd.install_examples

@github-actions github-actions bot added the state: CI Updated CI scenario have been updated in the PR label Oct 2, 2024
Copy link
Contributor

@ClausHolbechArista ClausHolbechArista left a comment

Choose a reason for hiding this comment

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

This is a lot of changes. Seems like we most messages could be replaced by a "var_path" and a "context" or similar. So we could build the message with similar wording every time.

python-avd/pyavd/_eos_designs/eos_designs_facts/vlans.py Outdated Show resolved Hide resolved
python-avd/pyavd/_errors/__init__.py Outdated Show resolved Hide resolved
@gmuloc gmuloc marked this pull request as ready for review October 3, 2024 11:42
@gmuloc gmuloc requested review from a team as code owners October 3, 2024 11:42
@github-actions github-actions bot added the state: conflict PR with conflict label Oct 3, 2024
Copy link

github-actions bot commented Oct 3, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link

github-actions bot commented Oct 3, 2024

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions github-actions bot removed the state: conflict PR with conflict label Oct 3, 2024
Copy link

sonarcloud bot commented Oct 3, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: CI Updated CI scenario have been updated in the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants