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

[PR #1124/3a566999 backport][stable-1] Update postgresql_pg_hba.py #1151

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Oct 21, 2020

This is a backport of PR #1124 as merged into main (3a56699).

Fixes #1108

SUMMARY

Fixes #1108

ISSUE TYPE
  • Bugfix Pull Request
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.

* 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)
@ansibullbot ansibullbot added affects_2.10 bug This issue/PR relates to a bug community_review database integration tests/integration module module needs_triage new_contributor Help guide this first time contributor plugins plugin (any type) postgresql tests tests labels Oct 21, 2020
@felixfontein felixfontein merged commit d0a9ced into stable-1 Oct 21, 2020
@felixfontein felixfontein deleted the patchback/backports/stable-1/3a5669991f321ef8afa9f34e0e4cd9dc6024c88d/pr-1124 branch October 21, 2020 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug community_review database integration tests/integration module module needs_triage new_contributor Help guide this first time contributor plugins plugin (any type) postgresql tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants