From 84c12a11a32d38f7d7d8297e13374f0c74a06d3f Mon Sep 17 00:00:00 2001 From: xuezhixin Date: Mon, 11 Nov 2024 17:13:15 +0800 Subject: [PATCH] compare with agent ip --- 0014-compare-with-request-agent-ip.patch | 34 ++++++++++++++++++++++++ migration-tools.spec | 6 ++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 0014-compare-with-request-agent-ip.patch diff --git a/0014-compare-with-request-agent-ip.patch b/0014-compare-with-request-agent-ip.patch new file mode 100644 index 0000000..918c4f3 --- /dev/null +++ b/0014-compare-with-request-agent-ip.patch @@ -0,0 +1,34 @@ +From 3b4ff69c1c59e004fe8c8b60220cf98e0461d847 Mon Sep 17 00:00:00 2001 +From: xuezhixin +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 + diff --git a/migration-tools.spec b/migration-tools.spec index 1a6c3aa..9073361 100644 --- a/migration-tools.spec +++ b/migration-tools.spec @@ -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 - 1.0.3-14 +- 0014-compare-with-request-agent-ip.patch + * Mon Nov 11 2024 xuezhixin - 1.0.3-13 - 0013-set-agent-migration-task.patch -- Gitee