mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-18 16:31:26 -07:00
Change suggested
This commit is contained in:
parent
0de26b08bd
commit
14a4a2db38
3 changed files with 5 additions and 35 deletions
|
@ -242,6 +242,7 @@ import warnings
|
|||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible_collections.community.mysql.plugins.module_utils.mysql import mysql_connect, mysql_driver, mysql_driver_fail_msg, mysql_common_argument_spec
|
||||
from ansible.module_utils._text import to_native
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
executed_queries = []
|
||||
|
||||
|
@ -256,40 +257,12 @@ def uses_replica_terminology(cursor):
|
|||
else:
|
||||
version_str = result[0]
|
||||
|
||||
version = version_str.split('.')
|
||||
|
||||
ver_major = int(version[0])
|
||||
ver_minor = int(version[1])
|
||||
if '-' in version[2]:
|
||||
ver_patch = int(version[2].split('-')[0])
|
||||
else:
|
||||
ver_patch = int(version[2])
|
||||
version = LooseVersion(version_str)
|
||||
|
||||
if 'mariadb' in version_str.lower():
|
||||
# Since MariaDB 10.5.1
|
||||
if ver_major > 10:
|
||||
return True
|
||||
|
||||
elif ver_major == 10 and ver_minor > 5:
|
||||
return True
|
||||
|
||||
elif ver_major == 10 and ver_minor == 5 and ver_patch >= 1:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
return version >= LooseVersion('10.5.1')
|
||||
else:
|
||||
# Since MySQL 8.0.22
|
||||
if ver_major > 8:
|
||||
return True
|
||||
|
||||
elif ver_major == 8 and ver_minor > 0:
|
||||
return True
|
||||
|
||||
elif ver_major == 8 and ver_minor == 0 and ver_patch >= 22:
|
||||
return True
|
||||
|
||||
return False
|
||||
return version >= LooseVersion('8.0.22')
|
||||
|
||||
|
||||
def get_master_status(cursor):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue