summaryrefslogtreecommitdiff
path: root/lib/ansible/modules/database/postgresql/postgresql_ext.py
diff options
context:
space:
mode:
authorAndrey Klychkov <aaklychkov@mail.ru>2019-06-19 16:49:19 +0300
committerToshio Kuratomi <a.badger@gmail.com>2019-06-19 06:49:19 -0700
commit64d0559e9f36532bcedcc6beb6890447efbc84f3 (patch)
tree36dec5f7e1aded86f761c65914eaa6b889fb791a /lib/ansible/modules/database/postgresql/postgresql_ext.py
parent6bace8aa5444c7b2ec8be53d0ec615c2a6763af0 (diff)
downloadansible-64d0559e9f36532bcedcc6beb6890447efbc84f3.tar.gz
Postgres module_utils: add get_connect_params + unit tests (#58067)
* add get_conn_params * add get_conn_params: add to the modules
Diffstat (limited to 'lib/ansible/modules/database/postgresql/postgresql_ext.py')
-rw-r--r--lib/ansible/modules/database/postgresql/postgresql_ext.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/ansible/modules/database/postgresql/postgresql_ext.py b/lib/ansible/modules/database/postgresql/postgresql_ext.py
index 649d894b37..f37672a2d1 100644
--- a/lib/ansible/modules/database/postgresql/postgresql_ext.py
+++ b/lib/ansible/modules/database/postgresql/postgresql_ext.py
@@ -143,7 +143,11 @@ except ImportError:
pass
from ansible.module_utils.basic import AnsibleModule
-from ansible.module_utils.postgres import connect_to_db, postgres_common_argument_spec
+from ansible.module_utils.postgres import (
+ connect_to_db,
+ get_conn_params,
+ postgres_common_argument_spec,
+)
from ansible.module_utils._text import to_native
from ansible.module_utils.database import pg_quote_identifier
@@ -216,7 +220,8 @@ def main():
cascade = module.params["cascade"]
changed = False
- db_connection = connect_to_db(module, autocommit=True)
+ conn_params = get_conn_params(module, module.params)
+ db_connection = connect_to_db(module, conn_params, autocommit=True)
cursor = db_connection.cursor(cursor_factory=DictCursor)
try: