migration-tools/0014-compare-with-request-agent-ip.patch
2024-11-11 17:13:15 +08:00

35 lines
979 B
Diff

From 3b4ff69c1c59e004fe8c8b60220cf98e0461d847 Mon Sep 17 00:00:00 2001
From: xuezhixin <xuezhixin@uniontech.com>
Date: Mon, 13 Nov 2023 16:24:00 +0800
Subject: [PATCH] =?UTF-8?q?IP=E6=98=AF=E5=90=A6=E5=92=8C=E8=AF=B7=E6=B1=82?=
=?UTF-8?q?=E7=9A=84agent=E7=9A=84IP=E5=8C=B9=E9=85=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sysmig_agent/fork.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/sysmig_agent/fork.py b/sysmig_agent/fork.py
index 23c10e2..8ad6d59 100644
--- a/sysmig_agent/fork.py
+++ b/sysmig_agent/fork.py
@@ -256,3 +256,13 @@ def system_migration(data):
timed_task_migrate(task_id, kernel_version)
post_server('task_close', task_id)
+
+def if_env_check(data):
+ agent_ips = list(json.loads(data).get('agent_ip'))
+ for n in range(len(agent_ips)):
+ ip = str(agent_ips[n])
+ if ip == get_local_ip():
+ return True
+ return False
+
+
--
2.20.1