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

EpTemplate() - remove template_name validation #355

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

allenrobel
Copy link
Collaborator

@allenrobel allenrobel commented Dec 11, 2024

Summary

EpTemplate() used FabricTypes() to validate the template_name property against a list of supported fabric templates. However, the intent of EpTemplate() is to retrieve other template types as well (interface, network, vrf, etc), so this validation isn't ideal in this larger context.

Changes

  1. Removes this validation and the associated import and instantiation of FabricTypes().

  2. Removes unit test that verified a ValueError is raised if template_name did not match one of the templates in FabricTypes().

EpTemplate() was using FabricTypes() to validate the template_name property against a list of valid and supported fabric templates.  However, the intent of EpTemplate() is to retrieve other template types as well (network, vrf, etc), so this validation isn't ideal in this larger context.

This commit removes this validation and the associated import and instantiation of FabricTypes.

There may be associated unit-tests that need to be updated.  Will investigate and handle in a second commit if so.
1. Remove test_ep_templates_00050()

This test validated that a ValueError is raised if template_name is invalid.  The test for validity entailed comparing against a list of fabric template names in FabricTypes().  However, EpTemplate() is now responsible for retrieving templates that are not in this list (e.g. interface templates, etc).  Hence, this test is no longer valid.
@allenrobel allenrobel added the ready for review PR is ready to be reviewed label Dec 11, 2024
@allenrobel allenrobel self-assigned this Dec 11, 2024
@allenrobel allenrobel requested a review from mikewiebe December 11, 2024 02:37
@mikewiebe mikewiebe merged commit 904144d into develop Dec 16, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review PR is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants