community.mysql
community.mysql copied to clipboard
change deprecated parameter pw and db
SUMMARY
Parameters db
and passwd
are deprecated, using database
and password
is recommended by the DB-API 2.0.
This MySQL collections support two connectors:
In PyMySQL the change from the short parameter to the new long-form was made with v0.6.7 (and the short forms are kept as an alias for database
and password
). Warnings will be activated around 2022 (for details, see PyMySQL/PyMySQL#939).
In MySQLdb the change was introduced with v1.3.8 (and the short forms are kept as an alias for database
and password
).
FIXES #176
ISSUE TYPE
- Feature Pull Request
COMPONENT NAME
module_utils
ADDITIONAL INFORMATION
This ought to be a more sensible way than #116.
Codecov Report
Merging #177 (34bcbce) into main (71b2742) will decrease coverage by
1.13%
. The diff coverage is22.22%
.
:exclamation: Current head 34bcbce differs from pull request most recent head 19d971d. Consider uploading reports for the commit 19d971d to get more accurate results
@@ Coverage Diff @@
## main #177 +/- ##
==========================================
- Coverage 76.92% 75.80% -1.13%
==========================================
Files 20 20
Lines 1794 1810 +16
Branches 439 449 +10
==========================================
- Hits 1380 1372 -8
- Misses 268 287 +19
- Partials 146 151 +5
Impacted Files | Coverage Δ | |
---|---|---|
plugins/module_utils/mysql.py | 64.64% <22.22%> (-18.49%) |
:arrow_down: |
plugins/modules/mysql_query.py | 86.58% <0.00%> (-2.44%) |
:arrow_down: |
plugins/modules/mysql_db.py | 74.21% <0.00%> (-0.35%) |
:arrow_down: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
@ziegenberg thanks for working on this!
@Jorge-Rodriguez as I remember you implemented very good checks for mysql versions. Maybe you have ideas on implementation?
@Andersson007 sure, I can get on that but I'm in the middle of moving, so I can't handle it straight away. I'll give it some thought in the meanwhile
@Jorge-Rodriguez sure, thanks!
@ziegenberg we should make the CI tests green. After that, we can ask our WG leader to review the PR, thanks!
Exception message: module 'MySQLdb' has no attribute '__version__'"
I can have a look at it on the weekend
@ziegenberg perfect (no rush)!
These changes are dependent on #141
Any updates on the PR? If it's irrelevant, please close it
The old versions of the database plugins are no longer supported on the collection. So I have removed the conditional checks, leaving only the currently supported parameter names, unconditionally.
@ziegenberg @Jorge-Rodriguez thanks for the contribution!