Fix wrong impl for mysql (#210)

If 'mariadb' in version info, the db instance should be mariadb(reverse in code) rather than mysql.
This commit is contained in:
int32bit 2021-08-25 15:21:24 +08:00 committed by GitHub
parent a1f419d541
commit 663590689f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -859,8 +859,8 @@ def get_impl(cursor):
global impl
cursor.execute("SELECT VERSION()")
if 'mariadb' in cursor.fetchone()[0].lower():
from ansible_collections.community.mysql.plugins.module_utils.implementations.mariadb import user as mysqluser
impl = mysqluser
else:
from ansible_collections.community.mysql.plugins.module_utils.implementations.mysql import user as mariauser
from ansible_collections.community.mysql.plugins.module_utils.implementations.mariadb import user as mariauser
impl = mariauser
else:
from ansible_collections.community.mysql.plugins.module_utils.implementations.mysql import user as mysqluser
impl = mysqluser