add version check for mariadb < 10.4.6 without mariadb* binaries

This commit is contained in:
Laurent Indermuehle 2025-03-06 13:55:17 +01:00
parent 3e2ef7ca92
commit b1e816ef1e
No known key found for this signature in database
GPG key ID: 93FA944C9F34DD09

View file

@ -389,7 +389,7 @@ def db_dump(module, host, user, password, db_name, target, all_databases, port,
if server_implementation == 'mysql':
cmd = module.get_bin_path('mysqldump', True)
elif server_implementation == 'mariadb':
elif server_implementation == 'mariadb' and LooseVersion(server_version) >= LooseVersion("10.4.6"):
cmd = module.get_bin_path('mariadb-dump', True)
else:
return module.fail_json(msg="Unknown server implementation %s" % server_implementation)
@ -483,7 +483,7 @@ def db_dump(module, host, user, password, db_name, target, all_databases, port,
def db_import(module, host, user, password, db_name, target, all_databases, port, config_file,
server_implementation, socket=None, ssl_cert=None, ssl_key=None, ssl_ca=None,
server_implementation, server_version, socket=None, ssl_cert=None, ssl_key=None, ssl_ca=None,
encoding=None, force=False,
use_shell=False, unsafe_password=False, restrict_config_file=False,
check_implicit_admin=False):
@ -492,7 +492,7 @@ def db_import(module, host, user, password, db_name, target, all_databases, port
if server_implementation == 'mysql':
cmd = [module.get_bin_path('mysql', True)]
elif server_implementation == 'mariadb':
elif server_implementation == 'mariadb' and LooseVersion(server_version) >= LooseVersion("10.4.6"):
cmd = [module.get_bin_path('mariadb', True)]
else:
return module.fail_json(msg="Unknown server implementation %s" % server_implementation)
@ -787,7 +787,7 @@ def main():
login_password, db, target,
all_databases,
login_port, config_file, server_implementation,
socket, ssl_cert, ssl_key, ssl_ca,
server_version, socket, ssl_cert, ssl_key, ssl_ca,
encoding, force, use_shell, unsafe_login_password,
restrict_config_file, check_implicit_admin)
if rc != 0: