From 812711d53048e9159158d1206cc39f45b7b35c22 Mon Sep 17 00:00:00 2001 From: Mark Theunissen Date: Thu, 26 Jul 2012 11:13:10 -0500 Subject: [PATCH] Woops, missed the rest of them --- mysql_db | 10 +++++----- mysql_user | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mysql_db b/mysql_db index 41c8e385de7..3a620f84941 100755 --- a/mysql_db +++ b/mysql_db @@ -78,20 +78,20 @@ def main(): # Either the caller passes both a username and password with which to connect to # mysql, or they pass neither and allow this module to read the credentials from # ~/.my.cnf. - loginpass = module.params["loginpass"] + loginpasswd = module.params["loginpasswd"] loginuser = module.params["loginuser"] - if loginuser is None and loginpass is None: + if loginuser is None and loginpasswd is None: mycnf_creds = load_mycnf() if mycnf_creds is False: module.fail_json(msg="incomplete login arguments passed and can't find them in ~/.my.cnf") else: loginuser = mycnf_creds["user"] - loginpass = mycnf_creds["passwd"] - elif loginpass is None or loginuser is None: + loginpasswd = mycnf_creds["passwd"] + elif loginpasswd is None or loginuser is None: module.fail_json(msg="when supplying login arguments, both user and pass must be provided") try: - db_connection = MySQLdb.connect(host=module.params["loginhost"], user=loginuser, passwd=loginpass, db="mysql") + db_connection = MySQLdb.connect(host=module.params["loginhost"], user=loginuser, passwd=loginpasswd, db="mysql") cursor = db_connection.cursor() except Exception as e: module.fail_json(msg="unable to connect to database") diff --git a/mysql_user b/mysql_user index 040ff2fbf26..6734961a749 100755 --- a/mysql_user +++ b/mysql_user @@ -187,20 +187,20 @@ def main(): # Either the caller passes both a username and password with which to connect to # mysql, or they pass neither and allow this module to read the credentials from # ~/.my.cnf. - loginpass = module.params["loginpass"] + loginpasswd = module.params["loginpasswd"] loginuser = module.params["loginuser"] - if loginuser is None and loginpass is None: + if loginuser is None and loginpasswd is None: mycnf_creds = load_mycnf() if mycnf_creds is False: module.fail_json(msg="incomplete login arguments passed and can't find them in ~/.my.cnf") else: loginuser = mycnf_creds["user"] - loginpass = mycnf_creds["passwd"] - elif loginpass is None or loginuser is None: + loginpasswd = mycnf_creds["passwd"] + elif loginpasswd is None or loginuser is None: module.fail_json(msg="when supplying login arguments, both user and pass must be provided") try: - db_connection = MySQLdb.connect(host=module.params["loginhost"], user=loginuser, passwd=loginpass, db="mysql") + db_connection = MySQLdb.connect(host=module.params["loginhost"], user=loginuser, passwd=loginpasswd, db="mysql") cursor = db_connection.cursor() except Exception as e: module.fail_json(msg="unable to connect to database")