mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-19 17:01:26 -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
|
@ -318,7 +318,6 @@ 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,11 +420,7 @@ def main():
|
|||
mode = get_mode(cursor)
|
||||
except Exception as e:
|
||||
module.fail_json(msg=to_native(e))
|
||||
try:
|
||||
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))
|
||||
priv = privileges_unpack(priv, mode)
|
||||
|
||||
if state == "present":
|
||||
if user_exists(cursor, user, host, host_all):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue