-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 redis cache #67125
base: master
Are you sure you want to change the base?
Fix redis cache #67125
Conversation
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
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.
This looks great. Could we get some tests and a changelog, please?
Since commit deeeaa3 the
redis_cache
module seems to have been broken in multiple places:The format of timestamp keys is malformed
This is because of an apparent attempt to refactor code to be compatible with older versions of python: the refactored code contains a silly copy-paste error that results in curly braces appearing in the keys, which breaks timestamp handling.
This PR fixes this mistake.
Listing child banks is broken, which results in commands like
salt-run cache.list minions
returning nothing every timeChild banks should be listed with
_get_bank_redis_key
instead of_get_bank_keys_redis_key
This PR fixes this mistake.
New objects get inserted in the wrong paths
The function
_build_bank_hier
seems to have been refactored from using a for-loop and several accumulating variables into a more functional style withitertools.accumulate
. However, instead of adding the names of child banks as set-members into the parent bank, the refactored code only adds a"."
member into each newly-created bank. This is a bug and causes all queries for nested banks to fail.This PR rewrites the function in a way that:
"."
member into newly-created banks