server send kernel detection task
This commit is contained in:
parent
90bef33139
commit
f9e0e6cdd2
50
0048-server-send-kernel-detection-task.patch
Normal file
50
0048-server-send-kernel-detection-task.patch
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
From 0e0d63d10ebbd4ee9a0f755e2a1178a69e3d6d9e Mon Sep 17 00:00:00 2001
|
||||||
|
From: xuezhixin <xuezhixin@uniontech.com>
|
||||||
|
Date: Fri, 10 Nov 2023 15:05:30 +0800
|
||||||
|
Subject: [PATCH] =?UTF-8?q?server=E4=B8=8B=E5=8F=91=E6=A3=80=E6=B5=8B?=
|
||||||
|
=?UTF-8?q?=E5=86=85=E6=A0=B8=E4=BB=BB=E5=8A=A1?=
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
---
|
||||||
|
sysmig_agent/short_task.py | 26 ++++++++++++++++++++++++++
|
||||||
|
1 file changed, 26 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/sysmig_agent/short_task.py b/sysmig_agent/short_task.py
|
||||||
|
index 1e1a1c8..23d461b 100644
|
||||||
|
--- a/sysmig_agent/short_task.py
|
||||||
|
+++ b/sysmig_agent/short_task.py
|
||||||
|
@@ -77,3 +77,29 @@ def os_repo_kernel():
|
||||||
|
else:
|
||||||
|
str_kernel = str_kernel + ',' + kernel_version.strip()
|
||||||
|
return str_kernel
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+def check_kernel(data):
|
||||||
|
+ task_id = json.loads(data).get('task_id')
|
||||||
|
+ # 更新SQL任务开始状态
|
||||||
|
+ sql_task_statue('1', task_id)
|
||||||
|
+ # 发送消息给Server更新任务流状态
|
||||||
|
+ post_server('task_start', task_id )
|
||||||
|
+ # agent kernel
|
||||||
|
+ agent_kernel = os_kernel()
|
||||||
|
+ # agent repo kernel
|
||||||
|
+ agent_repo_kernel = os_repo_kernel()
|
||||||
|
+ agent_ip = get_local_ip()
|
||||||
|
+ statue = 1
|
||||||
|
+ sql = "UPDATE agent_info SET agent_kernel = '{}',agent_repo_kernel = '{}' WHERE agent_ip = '{}';".format(
|
||||||
|
+ agent_kernel, agent_repo_kernel, agent_ip)
|
||||||
|
+ try:
|
||||||
|
+ DBHelper().execute(sql)
|
||||||
|
+ statue = 2
|
||||||
|
+ except:
|
||||||
|
+ statue = 3
|
||||||
|
+ sql_task_statue(statue, task_id)
|
||||||
|
+ sql_task_statue(statue, task_id)
|
||||||
|
+ post_server('task_close', task_id)
|
||||||
|
+ return 's'
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
Name: migration-tools
|
Name: migration-tools
|
||||||
Version: 1.0.2
|
Version: 1.0.2
|
||||||
Release: 47
|
Release: 48
|
||||||
License: MulanPSL-2.0
|
License: MulanPSL-2.0
|
||||||
Summary: A tool to help users migrate the Centos system to the UOS system and openEuler system
|
Summary: A tool to help users migrate the Centos system to the UOS system and openEuler system
|
||||||
Source0: %{name}-%{version}.tar.gz
|
Source0: %{name}-%{version}.tar.gz
|
||||||
@ -54,6 +54,8 @@ Patch44: 0044-migrate-in-myutiple-steps.patch
|
|||||||
Patch45: 0045-modify-repository-file.patch
|
Patch45: 0045-modify-repository-file.patch
|
||||||
Patch46: 0046-agent-sends-task-update-requrst-to-the-server.patch
|
Patch46: 0046-agent-sends-task-update-requrst-to-the-server.patch
|
||||||
Patch47: 0047-check-kernel-version-in-repository.patch
|
Patch47: 0047-check-kernel-version-in-repository.patch
|
||||||
|
Patch48: 0048-server-send-kernel-detection-task.patch
|
||||||
|
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
BuildRequires: systemd
|
BuildRequires: systemd
|
||||||
@ -152,6 +154,9 @@ rm -rf /usr/bin/migration-tools
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Nov 5 2024 xuezhixin <xuezhixin@uniontech.com> - 1.0.2-48
|
||||||
|
- 0048-server-send-kernel-detection-task.patch
|
||||||
|
|
||||||
* Tue Nov 5 2024 xuezhixin <xuezhixin@uniontech.com> - 1.0.2-47
|
* Tue Nov 5 2024 xuezhixin <xuezhixin@uniontech.com> - 1.0.2-47
|
||||||
- 0047-check-kernel-version-in-repository.patch
|
- 0047-check-kernel-version-in-repository.patch
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user