From 8dbc629c145ecee9c1d781ce1db3dca90f5edae7 Mon Sep 17 00:00:00 2001 From: Aleks Vagachev <43969425+aleksvagachev@users.noreply.github.com> Date: Tue, 9 May 2023 09:39:55 +0300 Subject: [PATCH] Fixed integration tests (#462) Co-authored-by: aleksvagachev --- plugins/modules/postgresql_privs.py | 12 ------------ .../tasks/postgresql_privs_general.yml | 8 ++++---- .../tasks/postgresql_user_initial.yml | 6 +++--- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/plugins/modules/postgresql_privs.py b/plugins/modules/postgresql_privs.py index fdce3caa..09ac49bb 100644 --- a/plugins/modules/postgresql_privs.py +++ b/plugins/modules/postgresql_privs.py @@ -494,18 +494,6 @@ class Connection(object): def __init__(self, params, module): self.database = params.database self.module = module - # To use defaults values, keyword arguments must be absent, so - # check which values are empty and don't include in the **kw - # dictionary - params_map = { - "login_host": "host", - "login_user": "user", - "login_password": "password", - "port": "port", - "database": "database", - "ssl_mode": "sslmode", - "ca_cert": "sslrootcert" - } conn_params = get_conn_params(module, params.__dict__, warn_db_default=False) diff --git a/tests/integration/targets/postgresql_privs/tasks/postgresql_privs_general.yml b/tests/integration/targets/postgresql_privs/tasks/postgresql_privs_general.yml index 834275c1..4b462101 100644 --- a/tests/integration/targets/postgresql_privs/tasks/postgresql_privs_general.yml +++ b/tests/integration/targets/postgresql_privs/tasks/postgresql_privs_general.yml @@ -88,7 +88,7 @@ - name: Set table default privs on the schema with hyphen in the name postgresql_privs: login_user: "{{ pg_user }}" - password: password + login_password: password db: "{{ db_name_with_hyphens }}" schema: "{{ db_schema_with_hyphens }}" role: "{{ db_user_with_hyphens }}" @@ -109,7 +109,7 @@ - name: Set table default privs on the schema with hyphen in the name postgresql_privs: login_user: "{{ pg_user }}" - password: password + login_password: password db: "{{ db_name_with_hyphens }}" schema: "{{ db_schema_with_hyphens }}" role: "{{ db_user_with_hyphens }}" @@ -128,7 +128,7 @@ - name: Delete table default privs on the schema with hyphen in the name postgresql_privs: login_user: "{{ pg_user }}" - password: password + login_password: password db: "{{ db_name_with_hyphens }}" schema: "{{ db_schema_with_hyphens }}" role: "{{ db_user_with_hyphens }}" @@ -160,7 +160,7 @@ name: "{{ db_user_with_hyphens }}" state: absent encrypted: true - password: password + login_password: password role_attr_flags: CREATEDB,LOGIN db: "{{ db_name_with_hyphens }}" login_user: "{{ pg_user }}" diff --git a/tests/integration/targets/postgresql_user/tasks/postgresql_user_initial.yml b/tests/integration/targets/postgresql_user/tasks/postgresql_user_initial.yml index 89028619..5d057d2d 100644 --- a/tests/integration/targets/postgresql_user/tasks/postgresql_user_initial.yml +++ b/tests/integration/targets/postgresql_user/tasks/postgresql_user_initial.yml @@ -101,9 +101,9 @@ privs: "CREATE,connect" objs: "{{ db_name }}" db: "{{ db_name }}" - login: "{{ db_user1 }}" - password: "password" - host: "localhost" + login_user: "{{ db_user1 }}" + login_password: "password" + login_host: "localhost" - name: Check that the user has the requested permissions (database) become: true