mysql_db: use new exception handling, fixes build (#4373)
This commit is contained in:
parent
9549883e78
commit
03022875c4
1 changed files with 4 additions and 3 deletions
|
@ -322,7 +322,7 @@ def main():
|
||||||
module.fail_json(msg="%s" % stderr)
|
module.fail_json(msg="%s" % stderr)
|
||||||
else:
|
else:
|
||||||
module.exit_json(changed=True, db=db, msg=stdout)
|
module.exit_json(changed=True, db=db, msg=stdout)
|
||||||
|
|
||||||
elif state == "import":
|
elif state == "import":
|
||||||
if module.check_mode:
|
if module.check_mode:
|
||||||
module.exit_json(changed=True, db=db)
|
module.exit_json(changed=True, db=db)
|
||||||
|
@ -334,7 +334,7 @@ def main():
|
||||||
module.fail_json(msg="%s" % stderr)
|
module.fail_json(msg="%s" % stderr)
|
||||||
else:
|
else:
|
||||||
module.exit_json(changed=True, db=db, msg=stdout)
|
module.exit_json(changed=True, db=db, msg=stdout)
|
||||||
|
|
||||||
elif state == "present":
|
elif state == "present":
|
||||||
if module.check_mode:
|
if module.check_mode:
|
||||||
module.exit_json(changed=False, db=db)
|
module.exit_json(changed=False, db=db)
|
||||||
|
@ -366,7 +366,8 @@ def main():
|
||||||
module.fail_json(msg="%s" % stderr)
|
module.fail_json(msg="%s" % stderr)
|
||||||
else:
|
else:
|
||||||
module.exit_json(changed=True, db=db, msg=stdout)
|
module.exit_json(changed=True, db=db, msg=stdout)
|
||||||
except Exception, e:
|
except Exception:
|
||||||
|
e = get_exception()
|
||||||
module.fail_json(msg="error creating database: " + str(e))
|
module.fail_json(msg="error creating database: " + str(e))
|
||||||
|
|
||||||
elif state == "absent":
|
elif state == "absent":
|
||||||
|
|
Loading…
Reference in a new issue