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)