From f2f0f83ee656e06062b3e33cf45129f37494fa5e Mon Sep 17 00:00:00 2001 From: Lee Hardy Date: Wed, 4 Nov 2015 16:37:18 +0000 Subject: [PATCH] - fix user_exists statement with host_all to use only username parameter --- lib/ansible/modules/database/mysql/mysql_user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/database/mysql/mysql_user.py b/lib/ansible/modules/database/mysql/mysql_user.py index f462d8920d..d2223bc6d5 100644 --- a/lib/ansible/modules/database/mysql/mysql_user.py +++ b/lib/ansible/modules/database/mysql/mysql_user.py @@ -235,7 +235,7 @@ def connect(module, login_user=None, login_password=None, config_file=''): def user_exists(cursor, user, host, host_all): if host_all: - cursor.execute("SELECT count(*) FROM user WHERE user = %s AND host = %s", (user,host)) + cursor.execute("SELECT count(*) FROM user WHERE user = %s", user) else: cursor.execute("SELECT count(*) FROM user WHERE user = %s AND host = %s", (user,host))