mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-19 17:01:26 -07:00
mysql_user: replace VALID_PRIVS by get_valid_privs() function (#217)
* mysql_user: replace VALID_PRIVS by get_valid_privs() function
* Add EXTRA_PRIVS in case we need to add more privs in the future
* Add changelog fragment
(cherry picked from commit 0ce1fa1634
)
This commit is contained in:
parent
6b8098e98a
commit
e8960d532a
4 changed files with 19 additions and 40 deletions
|
@ -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))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue