mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-19 08:51:26 -07:00
fix connection arguments for MySQLdb <2.0 !=1.0 (#553)
* fix connection arguments for MySQLdb <2.0 !=1.0 * add changelog fragment --------- Co-authored-by: Felix Hamme <felix.hamme@ionos.com>
This commit is contained in:
parent
bff05ce8dd
commit
b6ad472c78
2 changed files with 3 additions and 1 deletions
|
@ -154,7 +154,7 @@ def mysql_connect(module, login_user=None, login_password=None, config_file='',
|
|||
db_connection = mysql_driver.connect(autocommit=autocommit, **config)
|
||||
else:
|
||||
# In case of MySQLdb driver
|
||||
if mysql_driver.version_info[0] < 2 and mysql_driver.version_info[1] < 1:
|
||||
if mysql_driver.version_info[0] < 2 or (mysql_driver.version_info[0] == 2 and mysql_driver.version_info[1] < 1):
|
||||
# for MySQLdb < 2.1.0, use 'db' instead of 'database' and 'passwd' instead of 'password'
|
||||
if 'database' in config:
|
||||
config['db'] = config['database']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue