From 4ca142a37689780cabb2e1c198c8027aa0627650 Mon Sep 17 00:00:00 2001 From: Jorge-Rodriguez Date: Sun, 22 Jan 2023 08:41:38 +0200 Subject: [PATCH] Old plugin versions are no longer supported --- plugins/module_utils/mysql.py | 38 ++--------------------------------- 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/plugins/module_utils/mysql.py b/plugins/module_utils/mysql.py index 58f5bad..67e0033 100644 --- a/plugins/module_utils/mysql.py +++ b/plugins/module_utils/mysql.py @@ -79,24 +79,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: - if mysql_driver.__name__ == "pymysql": - # In case of PyMySQL driver: - version_tuple = (n for n in mysql_driver.__version__.split('.') if n != 'None') - if reduce(lambda x, y: int(x) * 100 + int(y), version_tuple) >= 607: - # pymysql >= 0.6.7 - config['password'] = login_password - else: - # NOTE: This check SHOULD be removed as soon as the minimum support version of PyMySQL for this collection reaches pymysql v0.6.7 - config['passwd'] = login_password - else: - # In case of MySQLdb driver - version_tuple = (n for n in mysql_driver.__version__.split('.') if n != 'None') - if reduce(lambda x, y: int(x) * 100 + int(y), version_tuple) >= 10308: - # mysqlclient >= 1.3.8 - config['password'] = login_password - else: - # NOTE: This check SHOULD be removed as soon as the minimum support version of MySQLdb for this collection reaches mysqlclient v1.3.8 - 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: @@ -104,24 +87,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: - if mysql_driver.__name__ == "pymysql": - # In case of PyMySQL driver: - version_tuple = (n for n in mysql_driver.__version__.split('.') if n != 'None') - if reduce(lambda x, y: int(x) * 100 + int(y), version_tuple) >= 607: - # pymysql >= 0.6.7 - config['database'] = db - else: - # NOTE: This check SHOULD be removed as soon as the minimum support version of PyMySQL for this collection reaches pymysql v0.6.7 - config['db'] = db - else: - # In case of MySQLdb driver - version_tuple = (n for n in mysql_driver.__version__.split('.') if n != 'None') - if reduce(lambda x, y: int(x) * 100 + int(y), version_tuple) >= 10308: - # mysqlclient >= 1.3.8 - config['database'] = login_password - else: - # NOTE: This check SHOULD be removed as soon as the minimum support version of MySQLdb for this collection reaches mysqlclient v1.3.8 - config['db'] = db + config['database'] = db if connect_timeout is not None: config['connect_timeout'] = connect_timeout if check_hostname is not None: