!150 get agent kernel version

From: @xuezhizone 
Reviewed-by: @xingwei-liu 
Signed-off-by: @xingwei-liu
This commit is contained in:
openeuler-ci-bot 2024-11-11 08:58:31 +00:00 committed by Gitee
commit aaea851c73
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 45 additions and 2 deletions

View File

@ -0,0 +1,40 @@
From 939ef6edc6fb62922acafceb76139a0b0993fc3c Mon Sep 17 00:00:00 2001
From: xuezhixin <xuezhixin@uniontech.com>
Date: Mon, 13 Nov 2023 16:14:28 +0800
Subject: [PATCH] =?UTF-8?q?agent=E8=AF=B7=E6=B1=82=E5=8F=82=E6=95=B0?=
=?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=86=85=E6=A0=B8=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sysmig_agent/fork.py | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/sysmig_agent/fork.py b/sysmig_agent/fork.py
index 3f81aea..cbc4165 100644
--- a/sysmig_agent/fork.py
+++ b/sysmig_agent/fork.py
@@ -225,4 +225,17 @@ def mig_modify_statue(task_id):
ret = re.sub('[0-9]', '0', ret[0]) + ret[1]
sql_mig_statue(ret)
# loggea
- '''
\ No newline at end of file
+ '''
+
+
+
+def get_info_version(data):
+ info = json.loads(data).get('info')
+ for i in range(len(info)):
+ agent_info = json.dumps(info[i])
+ ip = json.loads(agent_info).get('agent_ip')
+ agent_ip = get_local_ip()
+ if ip == agent_ip:
+ version = json.loads(agent_info).get('kernel_version')
+ return version
+
--
2.20.1

View File

@ -1,6 +1,6 @@
Name: migration-tools
Version: 1.0.3
Release: 11
Release: 12
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
@ -18,7 +18,7 @@ Patch008: 0008-add-system-migration-task.patch
Patch009: 0009-get-abi-detection-process.patch
Patch010: 0010-update-abi-result-to-database.patch
Patch011: 0011-initializate-the-migration-status.patch
Patch012: 0012-get-agent-kernel-version.patch
BuildArch: noarch
BuildRequires: systemd
@ -117,6 +117,9 @@ rm -rf /usr/bin/migration-tools
%endif
%changelog
* Mon Nov 11 2024 xuezhixin <xuezhixin@uniontech.com> - 1.0.3-12
- 0012-get-agent-kernel-version.patch
* Mon Nov 11 2024 xuezhixin <xuezhixin@uniontech.com> - 1.0.3-11
- 0011-initializate-the-migration-status.patch