mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-20 01:11:27 -07:00
Get rid of privs comparison (#243)
* Remove all code related to VALID_PRIVS and get_valid_privs() * Add tests to update user with invalid privs * Re-raise InvalidPrivsError when granting privileges * Fix: compatibility with python2 * More explicit assertions as commented by Andersson007 * Add changelog fragment
This commit is contained in:
parent
e4de13aabe
commit
727b638d13
6 changed files with 45 additions and 66 deletions
|
@ -250,7 +250,6 @@ 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
|
||||
|
@ -1014,8 +1013,7 @@ def main():
|
|||
module.fail_json(msg=to_native(e))
|
||||
|
||||
try:
|
||||
valid_privs = get_valid_privs(cursor)
|
||||
priv = privileges_unpack(priv, mode, valid_privs)
|
||||
priv = privileges_unpack(priv, mode)
|
||||
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