Fix argument tuple

This commit is contained in:
Jorge-Rodriguez 2021-02-07 12:25:06 +02:00
parent e9fd1db200
commit 1146f66e09
No known key found for this signature in database
GPG key ID: 43153D1EFD8F7D90

View file

@ -616,8 +616,8 @@ def user_add(cursor, user, host, host_all, password, encrypted,
else: else:
query_with_args = "CREATE USER %s@%s", (user, host) query_with_args = "CREATE USER %s@%s", (user, host)
query_with_args_and_tls_requires = query_with_args + (tls_requires,) query_with_args_and_tls_requires = query_with_args + (tls_requires, locking)
cursor.execute(*mogrify(*query_with_args_and_tls_requires, locking)) cursor.execute(*mogrify(*query_with_args_and_tls_requires))
if new_priv is not None: if new_priv is not None:
for db_table, priv in iteritems(new_priv): for db_table, priv in iteritems(new_priv):
@ -645,6 +645,8 @@ def user_mod(cursor, user, host, host_all, password, encrypted,
# Determine what user management method server uses # Determine what user management method server uses
old_user_mgmt = use_old_user_mgmt(cursor) old_user_mgmt = use_old_user_mgmt(cursor)
locking = validate_account_locking(cursor, account_locking, module)
if host_all: if host_all:
hostnames = user_get_hostnames(cursor, user) hostnames = user_get_hostnames(cursor, user)
else: else:
@ -811,7 +813,7 @@ def user_mod(cursor, user, host, host_all, password, encrypted,
if tls_requires is not None: if tls_requires is not None:
query = " ".join((pre_query, "%s@%s")) query = " ".join((pre_query, "%s@%s"))
query_with_args = mogrify_requires(query, (user, host), tls_requires) query_with_args = mogrify_requires(query, (user, host), tls_requires, locking)
else: else:
query = " ".join((pre_query, "%s@%s REQUIRE NONE")) query = " ".join((pre_query, "%s@%s REQUIRE NONE"))
query_with_args = query, (user, host) query_with_args = query, (user, host)