mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-18 16:31:26 -07:00
[stable-2] Backport stable 2 4 (#219)
* Fix wrong impl for mysql (#210) If 'mariadb' in version info, the db instance should be mariadb(reverse in code) rather than mysql. (cherry picked from commit663590689f
) * Update README.md (#216) (cherry picked from commit4de0e25ea0
) * 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 commit0ce1fa1634
) Co-authored-by: int32bit <krystism@gmail.com> Co-authored-by: R.Sicart <roger.sicart@gmail.com>
This commit is contained in:
parent
0c462c84ff
commit
c5676ff0c9
5 changed files with 30 additions and 44 deletions
|
@ -250,6 +250,7 @@ from ansible_collections.community.mysql.plugins.module_utils.user import (
|
|||
get_mode,
|
||||
user_mod,
|
||||
privileges_grant,
|
||||
get_valid_privs,
|
||||
privileges_unpack,
|
||||
)
|
||||
from ansible.module_utils._text import to_native
|
||||
|
@ -1013,7 +1014,8 @@ def main():
|
|||
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