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
postgresql_user: fix bugs related to 'expires' option #23862
postgresql_user: fix bugs related to 'expires' option #23862
Conversation
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.
All look goods, just one question.
for i in range(len(current_role_attrs)): | ||
if current_role_attrs[i] != new_role_attrs[i]: | ||
changed = True | ||
changed = current_role_attrs != new_role_attrs |
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.
So , would it work for all psycopg2 version ?
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.
psycopg2.extras.DictRow
was already here in 1.99.12 (which was released in march 2005).
There is one more problem with "expires" code: there is no column rol_valid_until in a pg_authid relation. So this code always compare expires with a None. It should be changed. |
4359c85
to
fb1253c
Compare
fb1253c
to
97dda60
Compare
The test
|
d3a7acd
to
018236b
Compare
c8e9495
to
c8000d0
Compare
from hashlib import md5 | ||
import itertools | ||
import re | ||
|
||
from distutils.version import StrictVersion |
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.
I'd move the hashlib import down here... imports are usually
import stdlib_foo
from stdlib_foo import bar
import thridparty_foo
from thirdparty_foo import bar
import project_foo
from project_foo import bar
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.
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.
Based on @abadger's comment, due to it being from hashlib import md5
it should go below import re
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.
oh right, I misunderstood! I fixed that and other PEP 8 related problems.
shipit |
Merged to devel. Doesn't cherrypick cleanly and I'm going on a one week vacation followed by ansiblefest London so I didn't want to backport it. If you think it should be backported, feel free to ask one of the other devs if they think it should be. |
This pull-request contains 4 one-liner fixes and many commits related to the tests. Without the bugfixes, Are there any recommendations/policies about backport of bugfixes ? I have created a branch based on stable-2.3 with the 4 one-liners cherry picked. I have referenced the squashed commit, should I use commit id before the squash instead ? |
… (#26539) * Change 'valid until' even it's the only updated field (cherry picked from commit 460d932) * value is changed when another value is provided (cherry picked from commit 460d932) * value isn't returned when unset (cherry picked from commit 460d932) * Fix comparison between user input and applied configuration (cherry picked from commit 460d932)
… (#26539) * Change 'valid until' even it's the only updated field (cherry picked from commit 460d932) * value is changed when another value is provided (cherry picked from commit 460d932) * value isn't returned when unset (cherry picked from commit 460d932) * Fix comparison between user input and applied configuration (cherry picked from commit 460d932) (cherry picked from commit 5432414)
SUMMARY
Add tests and fix various errors related to the
expires
option. The last 4 commits improve readability.ISSUE TYPE
COMPONENT NAME
postgresql_user
ANSIBLE VERSION
ADDITIONAL INFORMATION
Locally tested using:
Related pull-requests: