From 5e542caf4ab6703c932630b46979da4e73e5cdce Mon Sep 17 00:00:00 2001 From: Aidaho Date: Wed, 13 Nov 2024 22:27:06 +0300 Subject: [PATCH] v8.1.1: Fix incorrect IP retrieval for cluster slaves Replaces a method call with direct attribute access for retrieving the IP address of cluster slaves. This simplifies the code and improves performance by eliminating unnecessary database queries. --- app/modules/service/installation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/modules/service/installation.py b/app/modules/service/installation.py index 912d85f..9f714d7 100644 --- a/app/modules/service/installation.py +++ b/app/modules/service/installation.py @@ -82,7 +82,7 @@ def generate_kp_inv(json_data: json, installed_service) -> object: routers[router_id].setdefault('use_src', vip.use_src) slaves = ha_sql.select_cluster_slaves_for_inv(router_id) for slave in slaves: - slave_ip = server_sql.get_server(int(slave.server_id)).ip + slave_ip = slave.server_id.ip routers[router_id].setdefault(slave_ip, dict()) routers[router_id][slave_ip].setdefault('master', slave.master) routers[router_id][slave_ip].setdefault('eth', slave.eth)