From 888ac86d70460511c77800869de41c97f7123c66 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 --- library/mysql_db | 10 +++++----- library/mysql_user | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/library/mysql_db b/library/mysql_db index 41c8e385de..3a620f8494 100755 --- a/library/mysql_db +++ b/library/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/library/mysql_user b/library/mysql_user index 040ff2fbf2..6734961a74 100755 --- a/library/mysql_user +++ b/library/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")