diff options
author | Michael Scherer <misc@zarb.org> | 2016-10-16 16:57:57 +0200 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2016-10-17 13:14:02 -0700 |
commit | f2ce143609d8eb2af9b3d8f6f89f7dd4ea68eb22 (patch) | |
tree | d863ddb33e5c004b1620964ae10413b5a5e7560a /database/postgresql/postgresql_lang.py | |
parent | 4c6247c661eb6bb979829e176fabdaf02b23881d (diff) | |
download | ansible-modules-extras-f2ce143609d8eb2af9b3d8f6f89f7dd4ea68eb22.tar.gz |
Make postgresql module in extras compile on py3
Diffstat (limited to 'database/postgresql/postgresql_lang.py')
-rw-r--r-- | database/postgresql/postgresql_lang.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/database/postgresql/postgresql_lang.py b/database/postgresql/postgresql_lang.py index 73ecb413..a0b24cdd 100644 --- a/database/postgresql/postgresql_lang.py +++ b/database/postgresql/postgresql_lang.py @@ -222,7 +222,8 @@ def main(): try: db_connection = psycopg2.connect(**kw) cursor = db_connection.cursor() - except Exception, e: + except Exception: + e = get_exception() module.fail_json(msg="unable to connect to database: %s" % e) changed = False lang_dropped = False @@ -267,4 +268,5 @@ def main(): # import module snippets from ansible.module_utils.basic import * +from ansible.module_utils.pycompat24 import get_exception main() |