This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Push UX2 - Create config group and feature profiles (#492)
* Push UX2 - Create config group and feature profiles * Simplify push_ux2_config * UX2Config rework * Refactor code for template definition normalization This commit refactors the code responsible for normalizing template definitions by implementing improved type annotations, better function organization, and enhanced error handling. Key changes include: 1. Refactoring the to_snake_case function to use the str.replace method for kebab-case to snake_case conversion. 2. Improving the cast_value_to_global function to handle different types of input values, including lists and IP addresses, and utilizing IPv4Address and IPv6Address from the ipaddress module. 3. Enhancing the transform_dict function to handle nested dictionaries and lists, casting leaf values to global types recursively. 4. Updating the template_definition_normalization function to utilize the refactored transform_dict function for key transformation and value normalization. These changes improve code readability, maintainability, and robustness, providing a more efficient and reliable solution for template definition normalization. * Add tests for normalization and Literal casting --------- Co-authored-by: Kuba <[email protected]> Co-authored-by: sbasan <[email protected]> Co-authored-by: Jakub Krajewski <[email protected]>
- Loading branch information
1 parent
e79a479
commit 1ecfc0d
Showing
23 changed files
with
567 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
catalystwan/models/configuration/feature_profile/converters/feature_template/logging.py
This file was deleted.
Oops, something went wrong.
80 changes: 0 additions & 80 deletions
80
catalystwan/models/configuration/feature_profile/converters/feature_template/normalizator.py
This file was deleted.
Oops, something went wrong.
21 changes: 15 additions & 6 deletions
21
catalystwan/models/configuration/feature_profile/sdwan/system/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.