Fix sanity issues

This commit is contained in:
Jorge-Rodriguez 2020-09-30 08:37:55 +03:00
parent 3f3f7e7b26
commit 09c528dd06
No known key found for this signature in database
GPG key ID: 43153D1EFD8F7D90

View file

@ -83,7 +83,7 @@ def mysql_connect(module, login_user=None, login_password=None, config_file='',
if check_hostname is not None:
if mysql_driver.__name__ == "pymysql":
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) >= 711:
if reduce(lambda x, y: int(x) * 100 + int(y), version_tuple) >= 711:
config['ssl']['check_hostname'] = check_hostname
else:
module.fail_json(msg='To use check_hostname, pymysql >= 0.7.11 is required on the target host')