change deprecated parameter pw and db ()

* change deprecated parameter pw to password

* change deprecated parameter db to database

* add changelog fragment

* Old plugin versions are no longer supported

* Use packaging version checking.

* Use stdlib version comparison

* Use parse_version from setuptools

* Revert to tuple/reduce version check

---------

Co-authored-by: Jorge-Rodriguez <jorge.rodriguez@futurice.com>
This commit is contained in:
Daniel Ziegenberg 2023-02-10 09:47:12 +01:00 committed by GitHub
parent 9acbd55e44
commit 2f151dc8f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions
changelogs/fragments
plugins/module_utils

View file

@ -0,0 +1,2 @@
minor_changes:
- mysql module utils - change deprecated connection parameters ``passwd`` and ``db`` to ``password`` and ``database`` (https://github.com/ansible-collections/community.mysql/pull/177).

View file

@ -122,7 +122,7 @@ def mysql_connect(module, login_user=None, login_password=None, config_file='',
if login_user is not None:
config['user'] = login_user
if login_password is not None:
config['passwd'] = login_password
config['password'] = login_password
if ssl_cert is not None:
config['ssl']['cert'] = ssl_cert
if ssl_key is not None:
@ -130,7 +130,7 @@ def mysql_connect(module, login_user=None, login_password=None, config_file='',
if ssl_ca is not None:
config['ssl']['ca'] = ssl_ca
if db is not None:
config['db'] = db
config['database'] = db
if connect_timeout is not None:
config['connect_timeout'] = connect_timeout
if check_hostname is not None: