-
Notifications
You must be signed in to change notification settings - Fork 61
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(cv_device_v3): Fix strict mode not inheriting configlets from containers #424
Merged
titom73
merged 8 commits into
aristanetworks:devel
from
guillaumeVilar:cv_device_v3-fix-strict-inheritance
Dec 10, 2021
Merged
Fix(cv_device_v3): Fix strict mode not inheriting configlets from containers #424
titom73
merged 8 commits into
aristanetworks:devel
from
guillaumeVilar:cv_device_v3-fix-strict-inheritance
Dec 10, 2021
Conversation
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
github-actions
bot
added
module: cv_device_v3
Issue related to cv_device module in v3
module_utils: cv_client
cv_client implementation issue
labels
Dec 3, 2021
guillaumeVilar
changed the title
Fix(device_v3): Fix strict mode not inheriting configlets from containers
Fix(cv_device_v3): Fix strict mode not inheriting configlets from containers
Dec 3, 2021
…iner to reduce number of API calls
…rom_container using api.filter_topology()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, also tested and worked like a charm!
titom73
reviewed
Dec 10, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
module: cv_device_v3
Issue related to cv_device module in v3
module_utils: cv_client
cv_client implementation issue
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Summary
Fix device_v3 module strict mode not getting configlets from parent containers.
Related Issue(s)
Fixes #353
Fixes #400
Component(s) name
arista.cvp.cv_device_v3
Proposed changes
The way I implemented the fix is by constructing a list of configlets applied to the container's parent of the devices.
This is implemented in the function
device_tools.py:__get_configlet_list_inherited_from_container
.__cv_client.api.filter_topology()
__cv_client.api.get_configlets_by_container_id(container_id)
The number of API calls made is (1 + n) where n is the number of containers to explore.
All the API informations are cached in the attribute
self.__containers_configlet_list_cache
to avoid any unnecessary API call to the CVP server.How to test
Apply some configlets to devices and remove them with the strict state enabled.
Example (The configlets
TO_DETACH
andTO_DETACH2
are applied at the device level, some configlets need also to be applied at the containers level):The expected output is to have the configlets
TO_DETACH
andTO_DETACH2
removed. The configlets applied at container level must be kept.Checklist
Repository Checklist