From bc92170242ed2dc456e284b796dccc81e6ff18ac Mon Sep 17 00:00:00 2001 From: tcraxs Date: Wed, 20 Nov 2019 06:43:20 +0100 Subject: [PATCH] fix module that it reports the correct status of a change (#65061) --- ...ivs-always-reports-as-changed-when-using-default_privs.yml | 2 ++ lib/ansible/modules/database/postgresql/postgresql_privs.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/64371-postgresql_privs-always-reports-as-changed-when-using-default_privs.yml diff --git a/changelogs/fragments/64371-postgresql_privs-always-reports-as-changed-when-using-default_privs.yml b/changelogs/fragments/64371-postgresql_privs-always-reports-as-changed-when-using-default_privs.yml new file mode 100644 index 00000000000..f1a26fc7aac --- /dev/null +++ b/changelogs/fragments/64371-postgresql_privs-always-reports-as-changed-when-using-default_privs.yml @@ -0,0 +1,2 @@ +bugfixes: +- postgresql_privs.py - fix reports as changed behavior of module when using ``type=default_privs`` (https://github.com/ansible/ansible/issues/64371). diff --git a/lib/ansible/modules/database/postgresql/postgresql_privs.py b/lib/ansible/modules/database/postgresql/postgresql_privs.py index d4433e57804..eafe4578d3e 100644 --- a/lib/ansible/modules/database/postgresql/postgresql_privs.py +++ b/lib/ansible/modules/database/postgresql/postgresql_privs.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- # Copyright: Ansible Project +# Copyright: (c) 2019, Tobias Birkefeld (@tcraxs) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function @@ -194,6 +195,7 @@ extends_documentation_fragment: author: - Bernhard Weitzhofer (@b6d) +- Tobias Birkefeld (@tcraxs) ''' EXAMPLES = r''' @@ -778,7 +780,7 @@ class Connection(object): executed_queries.append(query) self.cursor.execute(query) status_after = get_status(objs) - return status_before != status_after + return status_before.sort() != status_after.sort() class QueryBuilder(object):