From bc3bbf54d9d4252fec199afb4adb8089ac6ad187 Mon Sep 17 00:00:00 2001 From: John Gibson Date: Tue, 18 Apr 2023 14:31:25 -0400 Subject: [PATCH] Fix connect_params being ignored --- plugins/modules/postgresql_privs.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/plugins/modules/postgresql_privs.py b/plugins/modules/postgresql_privs.py index 4aba56c10..704b69d1d 100644 --- a/plugins/modules/postgresql_privs.py +++ b/plugins/modules/postgresql_privs.py @@ -441,7 +441,7 @@ pg_quote_identifier, check_input, ) -from ansible_collections.community.postgresql.plugins.module_utils.postgres import postgres_common_argument_spec +from ansible_collections.community.postgresql.plugins.module_utils.postgres import postgres_common_argument_spec, get_conn_params from ansible.module_utils._text import to_native VALID_PRIVS = frozenset(('SELECT', 'INSERT', 'UPDATE', 'DELETE', 'TRUNCATE', @@ -507,13 +507,7 @@ def __init__(self, params, module): "ca_cert": "sslrootcert" } - kw = dict((params_map[k], getattr(params, k)) for k in params_map - if getattr(params, k) != '' and getattr(params, k) is not None) - - # If a login_unix_socket is specified, incorporate it here. - is_localhost = "host" not in kw or kw["host"] == "" or kw["host"] == "localhost" - if is_localhost and params.login_unix_socket != "": - kw["host"] = params.login_unix_socket + conn_params = get_conn_params(module, module.params, warn_db_default=False) sslrootcert = params.ca_cert if psycopg2.__version__ < '2.4.3' and sslrootcert is not None: