mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-07-28 07:31:24 -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
|
@ -178,6 +178,23 @@
|
|||
that:
|
||||
- "result.changed == false"
|
||||
|
||||
# ============================================================
|
||||
- name: update user with invalid privileges
|
||||
mysql_user:
|
||||
<<: *mysql_params
|
||||
name: '{{ user_name_2 }}'
|
||||
password: '{{ user_password_2 }}'
|
||||
priv: '*.*:INVALID'
|
||||
state: present
|
||||
register: result
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Assert that priv did not change
|
||||
assert:
|
||||
that:
|
||||
- result is failed
|
||||
- "'Error granting privileges' in result.msg"
|
||||
|
||||
- name: remove username
|
||||
mysql_user:
|
||||
<<: *mysql_params
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue