Merge pull request #1423 from ercpe/mysql_db-debugging
Improved output of mysql_db plugin
This commit is contained in:
commit
7a6f532020
1 changed files with 2 additions and 2 deletions
|
@ -346,11 +346,11 @@ def main():
|
|||
db_connection = MySQLdb.connect(host=module.params["login_host"], port=login_port, user=login_user, passwd=login_password, db=connect_to_db)
|
||||
cursor = db_connection.cursor()
|
||||
except Exception, e:
|
||||
if "Unknown database" in str(e):
|
||||
errno, errstr = e.args
|
||||
if "Unknown database" in str(e):
|
||||
module.fail_json(msg="ERROR: %s %s" % (errno, errstr))
|
||||
else:
|
||||
module.fail_json(msg="unable to connect, check login credentials (login_user, and login_password, which can be defined in ~/.my.cnf), check that mysql socket exists and mysql server is running")
|
||||
module.fail_json(msg="unable to connect, check login credentials (login_user, and login_password, which can be defined in ~/.my.cnf), check that mysql socket exists and mysql server is running (ERROR: %s %s)" % (errno, errstr))
|
||||
|
||||
changed = False
|
||||
if db_exists(cursor, db):
|
||||
|
|
Loading…
Reference in a new issue