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

Support version 3 of the redis python library #49445

Merged
merged 2 commits into from
Dec 5, 2018
Merged

Conversation

sivel
Copy link
Member

@sivel sivel commented Dec 3, 2018

SUMMARY

Support version 3 of the redis python library. Fixes #49341

Version 3 added the following backwards incompatible change:

* 3.0.0
  BACKWARDS INCOMPATIBLE CHANGES
    * ZADD now requires all element names/scores be specified in a single
      dictionary argument named mapping. This was required to allow the NX,
      XX, CH and INCR options to be specified.
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/plugins/cache/redis.py

ADDITIONAL INFORMATION

@sivel sivel requested a review from bcoca December 3, 2018 15:54
@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. community_review In order to be merged, this PR must follow the community review workflow. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. labels Dec 3, 2018
@@ -99,7 +99,10 @@ def set(self, key, value):
else:
self._db.set(self._make_key(key), value2)

self._db.zadd(self._keys_set, time.time(), key)
if VERSION[0] == 2:
Copy link
Member

Choose a reason for hiding this comment

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

we probably want <= 2 ... those using the OS package for redis python might have ancient libs

Copy link
Member Author

Choose a reason for hiding this comment

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

As part of verifying that VERSION was available, I checked the tags in GitHub, and found that 2.4.6 (the oldest in GitHub) was released in Jul 13, 2011. It seems as though 2.4.5 was when VERSION was added. Roughly 2.4.5 was released around Jun 7, 2011.

As such, this change would put a requirement on at least 2.4.5, although I have no idea whether other functionality would work this far back.

Copy link
Member

Choose a reason for hiding this comment

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

gtk, so it will just fail on import for older redis, we might want to capture that and state min requirement is 2.4.5

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Dec 3, 2018
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. community_review In order to be merged, this PR must follow the community review workflow. and removed community_review In order to be merged, this PR must follow the community review workflow. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Dec 3, 2018
@sivel sivel merged commit 77de219 into ansible:devel Dec 5, 2018
sivel added a commit to sivel/ansible that referenced this pull request Dec 5, 2018
…9445)

* Support version 3 of the redis python library. Fixes ansible#49341

* Document 2.4.5 minimum redis-py version
(cherry picked from commit 77de219)

Co-authored-by: Matt Martz <matt@sivel.net>
abadger pushed a commit that referenced this pull request Dec 6, 2018
* Support version 3 of the redis python library. Fixes #49341

* Document 2.4.5 minimum redis-py version
(cherry picked from commit 77de219)

Co-authored-by: Matt Martz <matt@sivel.net>
kbreit pushed a commit to kbreit/ansible that referenced this pull request Jan 11, 2019
* Support version 3 of the redis python library. Fixes ansible#49341

* Document 2.4.5 minimum redis-py version
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. community_review In order to be merged, this PR must follow the community review workflow. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fact caching with Python Redis 3.0.x seems broken
3 participants