Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong impl for mysql #210

Merged
merged 1 commit into from
Aug 25, 2021
Merged

Conversation

int32bit
Copy link
Contributor

SUMMARY

If 'mariadb' in version info, the db instance should be mariadb(reverse in code) rather than mysql.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

community.mysql

ADDITIONAL INFORMATION

MariaDB output:

MariaDB [(none)]> SELECT VERSION() as version;
+----------------------------------------+
| version                                |
+----------------------------------------+
| 10.4.12-MariaDB-1:10.4.12+maria~bionic |
+----------------------------------------+
1 row in set (0.000 sec)

MySQL output:

MySQL [(none)]> SELECT VERSION() as version;
+---------+
| version |
+---------+
| 5.7.30  |
+---------+
1 row in set (0.01 sec)

According to the above output, if 'mariadb' in version info, the db instance should be mariadb(reverse in code) rather than mysql.

@Andersson007
Copy link
Collaborator

cc @Jorge-Rodriguez

@codecov
Copy link

codecov bot commented Aug 23, 2021

Codecov Report

Merging #210 (28acb5b) into main (a1f419d) will not change coverage.
The diff coverage is 66.66%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #210   +/-   ##
=======================================
  Coverage   77.53%   77.53%           
=======================================
  Files          24       24           
  Lines        2163     2163           
  Branches      509      509           
=======================================
  Hits         1677     1677           
  Misses        319      319           
  Partials      167      167           
Impacted Files Coverage Δ
plugins/module_utils/user.py 81.46% <66.66%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1f419d...28acb5b. Read the comment docs.

@Andersson007
Copy link
Collaborator

The failing task is

2021-08-23T05:28:48.9269875Z TASK [test_mysql_user : create user with equivalent ssl requirement in tls_requires (expect unchanged)] ***
2021-08-23T05:28:49.5424779Z �[0;33mchanged: [testhost] => {"changed": true, "msg": "TLS requires updated", "user": "db_user1"}�[0m
2021-08-23T05:28:49.5576889Z 
2021-08-23T05:28:49.5578632Z TASK [test_mysql_user : assert] ************************************************
2021-08-23T05:28:49.8391104Z �[0;31mfatal: [testhost]: FAILED! => {�[0m
2021-08-23T05:28:49.8392108Z �[0;31m    "assertion": "result is not changed",�[0m
2021-08-23T05:28:49.8392809Z �[0;31m    "changed": false,�[0m
2021-08-23T05:28:49.8393442Z �[0;31m    "evaluated_to": false,�[0m
2021-08-23T05:28:49.8394114Z �[0;31m    "msg": "Assertion failed"�[0m
2021-08-23T05:28:49.8394660Z �[0;31m}�[0m

plugins/module_utils/user.py Outdated Show resolved Hide resolved
If 'mariadb' in version info, the db instance should be mariadb(reverse in code) rather than mysql.
@Andersson007
Copy link
Collaborator

@int32bit (the codecove errors are unrelated) thanks for the contribution!

@Andersson007 Andersson007 merged commit 6635906 into ansible-collections:main Aug 25, 2021
@Andersson007
Copy link
Collaborator

BTW it's better to use dedicated branches for submitting pull requests than main. When submitting with main, we can end up in a situation when refork is required. We have this quick start guide which can help.

Andersson007 pushed a commit to Andersson007/community.mysql that referenced this pull request Sep 23, 2021
If 'mariadb' in version info, the db instance should be mariadb(reverse in code) rather than mysql.

(cherry picked from commit 6635906)
Andersson007 added a commit that referenced this pull request Sep 23, 2021
* 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 commit 6635906)

* Update README.md (#216)

(cherry picked from commit 4de0e25)

* 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 0ce1fa1)

Co-authored-by: int32bit <[email protected]>
Co-authored-by: R.Sicart <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants