mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Decode mysql_version for python3 compatibility
This commit is contained in:
parent
89b09912e1
commit
58791e9951
1 changed files with 4 additions and 4 deletions
|
@ -1265,7 +1265,7 @@ def user_exists(user,
|
|||
salt '*' mysql.user_exists 'username' password_column='authentication_string'
|
||||
'''
|
||||
run_verify = False
|
||||
server_version = version(**connection_args)
|
||||
server_version = salt.utils.data.decode(version(**connection_args))
|
||||
compare_version = '10.2.0' if 'MariaDB' in server_version else '8.0.11'
|
||||
dbc = _connect(**connection_args)
|
||||
# Did we fail to connect with the user we are checking
|
||||
|
@ -1404,7 +1404,7 @@ def user_create(user,
|
|||
salt '*' mysql.user_create 'username' 'hostname' password_hash='hash'
|
||||
salt '*' mysql.user_create 'username' 'hostname' allow_passwordless=True
|
||||
'''
|
||||
server_version = version(**connection_args)
|
||||
server_version = salt.utils.data.decode(version(**connection_args))
|
||||
compare_version = '10.2.0' if 'MariaDB' in server_version else '8.0.11'
|
||||
if user_exists(user, host, **connection_args):
|
||||
log.info('User \'%s\'@\'%s\' already exists', user, host)
|
||||
|
@ -1509,7 +1509,7 @@ def user_chpass(user,
|
|||
salt '*' mysql.user_chpass frank localhost password_hash='hash'
|
||||
salt '*' mysql.user_chpass frank localhost allow_passwordless=True
|
||||
'''
|
||||
server_version = version(**connection_args)
|
||||
server_version = salt.utils.data.decode(version(**connection_args))
|
||||
compare_version = '10.2.0' if 'MariaDB' in server_version else '8.0.11'
|
||||
args = {}
|
||||
if password is not None:
|
||||
|
@ -1865,7 +1865,7 @@ def grant_exists(grant,
|
|||
'SELECT,INSERT,UPDATE,...' 'database.*' 'frank' 'localhost'
|
||||
'''
|
||||
|
||||
server_version = version(**connection_args)
|
||||
server_version = salt.utils.data.decode(version(**connection_args))
|
||||
if 'ALL' in grant:
|
||||
if salt.utils.versions.version_cmp(server_version, '8.0') >= 0 and \
|
||||
'MariaDB' not in server_version:
|
||||
|
|
Loading…
Add table
Reference in a new issue