mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Use Python 2.4 compatible syntax
This commit is contained in:
parent
2adff56ef5
commit
bce1d4da53
1 changed files with 2 additions and 2 deletions
|
@ -83,7 +83,7 @@ def main():
|
||||||
# Enable autocommit so we can create databases
|
# Enable autocommit so we can create databases
|
||||||
db_connection.autocommit = True
|
db_connection.autocommit = True
|
||||||
cursor = db_connection.cursor()
|
cursor = db_connection.cursor()
|
||||||
except Exception as e:
|
except Exception, e:
|
||||||
module.fail_json(msg="unable to connect to database: %s" % e)
|
module.fail_json(msg="unable to connect to database: %s" % e)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -93,7 +93,7 @@ def main():
|
||||||
else:
|
else:
|
||||||
if state == "present":
|
if state == "present":
|
||||||
changed = db_create(cursor, db, owner, template, encoding)
|
changed = db_create(cursor, db, owner, template, encoding)
|
||||||
except Exception as e:
|
except Exception, e:
|
||||||
module.fail_json(msg="Database query failed: %s" % e)
|
module.fail_json(msg="Database query failed: %s" % e)
|
||||||
|
|
||||||
module.exit_json(changed=changed, db=db)
|
module.exit_json(changed=changed, db=db)
|
||||||
|
|
Loading…
Reference in a new issue