mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-23 10:51:25 -07:00
Refactoring change by moving common logic to the module_utils
This commit is contained in:
parent
c66a5ac3c4
commit
10660cf885
4 changed files with 54 additions and 49 deletions
|
@ -206,6 +206,23 @@ def get_server_version(cursor):
|
|||
|
||||
return version_str
|
||||
|
||||
def get_server_implementation(cursor):
|
||||
if 'mariadb' in get_server_version(cursor).lower():
|
||||
return "mariadb"
|
||||
else:
|
||||
return "mysql"
|
||||
|
||||
def is_mariadb(implementation):
|
||||
if implementation == "mariadb":
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def is_mysql(implementation):
|
||||
if implementation == "mysql":
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def set_session_vars(module, cursor, session_vars):
|
||||
"""Set session vars."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue