- fix user_exists statement with host_all to use only username parameter

This commit is contained in:
Lee Hardy 2015-11-04 16:37:18 +00:00
parent acdde856c5
commit 2aeb188d81

View file

@ -226,7 +226,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))