summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2015-05-14 23:21:15 +0200
committerGuilhem Moulin <guilhem@fripost.org>2015-06-07 02:53:31 +0200
commit9606090f1c334445151808cc12b2f4dbdcedb39b (patch)
tree47f77c70cc5a4e215704d00f65fa61a372ac0050
parentc54977c7c1b580225dd6499bd5770bb0945ff9a5 (diff)
typo
-rw-r--r--lib/modules/mysql_user2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/modules/mysql_user b/lib/modules/mysql_user
index 64e1f3d..054698e 100644
--- a/lib/modules/mysql_user
+++ b/lib/modules/mysql_user
@@ -135,41 +135,41 @@ password=n<_665{vS43y
import ConfigParser
import getpass
import tempfile
try:
import MySQLdb
except ImportError:
mysqldb_found = False
else:
mysqldb_found = True
# ===========================================
# MySQL module specific support methods.
#
def user_exists(cursor, user, host):
cursor.execute("SELECT count(*) FROM user WHERE user = %s AND host = %s", (user,host))
count = cursor.fetchone()
return count[0] > 0
def load_plugin(cursor, plugin):
- cursor.execute("SELECT count(*) FROM plugin WHERE name = %s", plugin)
+ cursor.execute("SELECT count(*) FROM information_schema.plugins WHERE name = %s", plugin)
count = cursor.fetchone()
if count[0] == 0:
so = "%s.so" % plugin
cursor.execute("INSTALL PLUGIN %s SONAME %s", (plugin, so))
def user_add(cursor, user, host, password, new_priv, auth_plugin):
if password is None:
# Automatically loaded on first first use.
load_plugin(cursor, auth_plugin)
cursor.execute("CREATE USER %s@%s IDENTIFIED WITH %s", (user,host,auth_plugin))
else:
cursor.execute("CREATE USER %s@%s IDENTIFIED BY %s", (user,host,password))
if new_priv is not None:
for db_table, priv in new_priv.iteritems():
privileges_grant(cursor, user,host,db_table,priv)
return True
def user_mod(cursor, user, host, password, new_priv, append_privs, auth_plugin):
changed = False
grant_option = False