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

Update cache of lldp entries #25

Merged
merged 2 commits into from
Sep 11, 2019

Conversation

pavel-shirshov
Copy link
Contributor

Fix for the bug: #24
self.interfaces_cache is not being changed by the code.
Also rewrite new,changed,deleted logic by using sets.

deleted_keys = [key for key in cache.keys() if key not in update.keys()]
new_keys = list(set(update.keys()) - set(cache.keys()))
changed_keys = list(set(key for key in set(update.keys()) & set(cache.keys()) if update[key] != cache[key]))
deleted_keys = list(set(cache.keys()) - set( update.keys()))
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the space.

Copy link
Contributor

Choose a reason for hiding this comment

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

set( update.keys())

@pavel-shirshov pavel-shirshov merged commit ffb3bad into sonic-net:master Sep 11, 2019
@pavel-shirshov pavel-shirshov deleted the fix_cache branch September 11, 2019 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants