!152 compare with agent ip

From: @xuezhizone 
Reviewed-by: @xingwei-liu 
Signed-off-by: @xingwei-liu
This commit is contained in:
openeuler-ci-bot 2024-11-11 09:25:27 +00:00 committed by Gitee
commit 01fdfddafa
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,34 @@
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

View File

@ -1,6 +1,6 @@
Name: migration-tools
Version: 1.0.3
Release: 13
Release: 14
License: MulanPSL-2.0
Summary: A tool to help users migrate the Centos system to the UOS system and openEuler system
Source0: %{name}-%{version}.tar.gz
@ -20,6 +20,7 @@ Patch010: 0010-update-abi-result-to-database.patch
Patch011: 0011-initializate-the-migration-status.patch
Patch012: 0012-get-agent-kernel-version.patch
Patch013: 0013-set-agent-migration-task.patch
Patch014: 0014-compare-with-request-agent-ip.patch
BuildArch: noarch
@ -119,6 +120,9 @@ rm -rf /usr/bin/migration-tools
%endif
%changelog
* Mon Nov 11 2024 xuezhixin <xuezhixin@uniontech.com> - 1.0.3-14
- 0014-compare-with-request-agent-ip.patch
* Mon Nov 11 2024 xuezhixin <xuezhixin@uniontech.com> - 1.0.3-13
- 0013-set-agent-migration-task.patch