diff options
author | Jonathan Mainguy <jmainguy@redhat.com> | 2015-10-27 13:03:51 -0400 |
---|---|---|
committer | Jonathan Mainguy <jmainguy@redhat.com> | 2015-10-27 13:03:51 -0400 |
commit | e101657722fa6457a97141858449b870e269f6af (patch) | |
tree | 15cab454bb12d518e619a26283b1418995f9f1d1 | |
parent | 1b3e82e4b0dade8048512876e893e2b219424630 (diff) | |
download | ansible-modules-core-e101657722fa6457a97141858449b870e269f6af.tar.gz |
Update error message to be more explicit
-rw-r--r-- | database/mysql/mysql_variables.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/database/mysql/mysql_variables.py b/database/mysql/mysql_variables.py index d7187e85..ab4848d6 100644 --- a/database/mysql/mysql_variables.py +++ b/database/mysql/mysql_variables.py @@ -244,7 +244,8 @@ def main(): db_connection = MySQLdb.connect(host=module.params["login_host"], port=module.params["login_port"], user=login_user, passwd=login_password, db="mysql") cursor = db_connection.cursor() except Exception, e: - module.fail_json(msg="unable to connect to database, check login_user and login_password are correct or ~/.my.cnf has the credentials") + errno, errstr = e.args + module.fail_json(msg="unable to connect to database, check login_user and login_password are correct or ~/.my.cnf has the credentials (ERROR: %s %s)" % (errno, errstr)) mysqlvar_val = getvariable(cursor, mysqlvar) if mysqlvar_val is None: module.fail_json(msg="Variable not available \"%s\"" % mysqlvar, changed=False) |