community.mysql icon indicating copy to clipboard operation
community.mysql copied to clipboard

change deprecated parameter pw and db

Open ziegenberg opened this issue 3 years ago • 7 comments

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.

ziegenberg avatar Jun 01 '21 21:06 ziegenberg

Codecov Report

Merging #177 (34bcbce) into main (71b2742) will decrease coverage by 1.13%. The diff coverage is 22.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.

codecov[bot] avatar Jun 01 '21 21:06 codecov[bot]

@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 avatar Jun 03 '21 05:06 Andersson007

@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 avatar Jun 09 '21 08:06 Jorge-Rodriguez

@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__'"

Andersson007 avatar Jun 09 '21 08:06 Andersson007

I can have a look at it on the weekend

ziegenberg avatar Jun 09 '21 10:06 ziegenberg

@ziegenberg perfect (no rush)!

Andersson007 avatar Jun 09 '21 10:06 Andersson007

These changes are dependent on #141

Jorge-Rodriguez avatar Nov 28 '21 11:11 Jorge-Rodriguez

Any updates on the PR? If it's irrelevant, please close it

Andersson007 avatar Jan 20 '23 08:01 Andersson007

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.

Jorge-Rodriguez avatar Jan 22 '23 06:01 Jorge-Rodriguez

@ziegenberg @Jorge-Rodriguez thanks for the contribution!

Andersson007 avatar Feb 10 '23 08:02 Andersson007