- 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 committed by Matt Clay
parent 22648e88cd
commit f2f0f83ee6

View file

@ -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))