-
Notifications
You must be signed in to change notification settings - Fork 1.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
Update postgresql_pg_hba.py #1124
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.
Please add a changelog fragment.
@sebasmannem hi, thanks for the quick fix! |
I will add a changelog fragment and will look at a unit test. |
@sebasmannem can't we just add the |
The test
The test
|
@sebasmannem please add |
I think the pr is ok without tests but if it's easy to add the case to the existing tests, it would be good |
I think I have a unit test. I will push it in first, to see it fail. |
Yes, unittest fails. Now lets re add feature which should fix the unit test |
We are all good |
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
@sebasmannem thanks for fixing this! |
* Update postgresql_pg_hba.py Fixes #1108 * Create changelog fragment for pull 1124 * Adding a unit test for pg_hba (cherry picked from commit 3a56699) Co-authored-by: Sebastiaan Mannem <[email protected]>
@Andersson007 , @felixfontein , many thanks to the both of you :) |
Fixes #1108
SUMMARY
Fixes #1108
ISSUE TYPE
COMPONENT NAME
postgresql_pg_hba.py
ADDITIONAL INFORMATION
The module was accessing dict values using square brackets, and apparently in this case, the old rule did not have 'options' set, and new one has.
Using the .get method is safer (returns None if key not set).
With this change, if oldrule does not have options set, and rule does(or the other way around), a PgHbaRuleChanged is raised, which will replace the old rule for the new, which is as expected.