1
0
Fork 0
mirror of https://github.com/ansible-collections/community.mysql.git synced 2026-02-04 07:11:49 +00:00

mysql_info: Add support for source terminology for slave_status filter (#747)

* mysql_info: Add support for source terminology for slave_status filter

* Update changelogs/fragments/mysql_info_fix_slave_status_for_source_terminology.yaml

---------

Co-authored-by: Luca Keidel <luca.keidel@check24.de>
Co-authored-by: Laurent Indermühle <laurent.indermuehle@pm.me>
This commit is contained in:
Luca Keidel 2025-10-08 10:29:18 +02:00 committed by GitHub
parent f6cec49238
commit fad6bc7564
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 37 additions and 4 deletions

View file

@ -531,20 +531,20 @@ class MySQL_Info(object):
res = self.__exec_sql(query)
if res:
for line in res:
host = line['Master_Host']
host = line.get('Master_Host') or line.get('Source_Host')
if host not in self.info['slave_status']:
self.info['slave_status'][host] = {}
port = line['Master_Port']
port = line.get('Master_Port') or line.get('Source_Port')
if port not in self.info['slave_status'][host]:
self.info['slave_status'][host][port] = {}
user = line['Master_User']
user = line.get('Master_User') or line.get('Source_User')
if user not in self.info['slave_status'][host][port]:
self.info['slave_status'][host][port][user] = {}
for vname, val in line.items():
if vname not in ('Master_Host', 'Master_Port', 'Master_User'):
if vname not in ('Master_Host', 'Master_Port', 'Master_User', 'Source_Host', 'Source_Port', 'Source_User'):
self.info['slave_status'][host][port][user][vname] = self.__convert(val)
def __get_slaves(self):