From 8621f9a7cd5ab1f6432283b647cc8cddcccec7a7 Mon Sep 17 00:00:00 2001 From: kustodian Date: Sat, 13 Dec 2014 17:24:10 +0100 Subject: [PATCH] Fixed postgresql_db failing on Python 2.4 with --check This reverts commit 81cbdb6c8cf54c41ba2ee3330c968e2feea05a5c and adds ignoring of the SystemExit exception because of Python 2.4. --- lib/ansible/modules/database/postgresql/postgresql_db.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/modules/database/postgresql/postgresql_db.py b/lib/ansible/modules/database/postgresql/postgresql_db.py index 233ae3d1c87..941644d6fb1 100644 --- a/lib/ansible/modules/database/postgresql/postgresql_db.py +++ b/lib/ansible/modules/database/postgresql/postgresql_db.py @@ -311,6 +311,9 @@ def main(): module.fail_json(msg=str(e)) except NotSupportedError, e: module.fail_json(msg=str(e)) + except SystemExit: + # Avoid catching this on Python 2.4 + raise except Exception, e: module.fail_json(msg="Database query failed: %s" % e)