1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Rollback if nothing changed (#887) (#925)

Since the module unconditionally issues ALTER statements in order to
observe their effect on the postgres catalog - to determine whether the
privileges have changes - a rollback is thus advisable when in fact
nothing has changed.

fix #885

(cherry picked from commit 2b3c8f4582)

Co-authored-by: Georg Sauthoff <mail@georg.so>
This commit is contained in:
patchback[bot] 2020-09-17 21:17:29 +02:00 committed by GitHub
parent 83339c44b3
commit ad4866bb3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- postgresql_privs - rollback if nothing changed (https://github.com/ansible-collections/community.general/issues/885).

View file

@ -1102,7 +1102,7 @@ def main():
conn.rollback() conn.rollback()
module.fail_json(msg=to_native(e.message)) module.fail_json(msg=to_native(e.message))
if module.check_mode: if module.check_mode or not changed:
conn.rollback() conn.rollback()
else: else:
conn.commit() conn.commit()