mysql_user: replace VALID_PRIVS by get_valid_privs() function

This commit is contained in:
R. Sicart 2021-09-22 12:14:42 +02:00
parent 663590689f
commit 255808bb69
3 changed files with 17 additions and 42 deletions

View file

@ -318,6 +318,7 @@ from ansible_collections.community.mysql.plugins.module_utils.user import (
handle_requiressl_in_priv_string,
InvalidPrivsError,
limit_resources,
get_valid_privs,
privileges_unpack,
sanitize_requires,
user_add,
@ -421,7 +422,8 @@ def main():
except Exception as e:
module.fail_json(msg=to_native(e))
try:
priv = privileges_unpack(priv, mode)
valid_privs = get_valid_privs(cursor)
priv = privileges_unpack(priv, mode, valid_privs)
except Exception as e:
module.fail_json(msg="invalid privileges string: %s" % to_native(e))