initializate the migration status

This commit is contained in:
xuezhixin 2024-11-11 16:22:33 +08:00
parent bb5d180913
commit 4f3f225621
2 changed files with 58 additions and 1 deletions

View File

@ -0,0 +1,53 @@
From 127580df37b9b0264af9b54e4618a9b0e1939dda Mon Sep 17 00:00:00 2001
From: xuezhixin <xuezhixin@uniontech.com>
Date: Mon, 13 Nov 2023 16:11:45 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E8=BF=81=E7=A7=BB?=
=?UTF-8?q?=E7=8A=B6=E6=80=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sysmig_agent/fork.py | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/sysmig_agent/fork.py b/sysmig_agent/fork.py
index 3447678..3f81aea 100644
--- a/sysmig_agent/fork.py
+++ b/sysmig_agent/fork.py
@@ -198,3 +198,31 @@ def abi_file_sql(path):
info_str = info_str+','
abi_file_connect(info_str)
+
+def check_environment(data):
+ task_id = json.loads(data).get('task_id')
+ # 更新SQL任务状态
+ sql_task_statue('1', task_id)
+ # 发送消息给Server更新任务流状态
+ post_server('task_start', task_id)
+ process_time_task_abi(task_id)
+ # tar.gz types abi report
+ targz_mig_dir_abi()
+ sql_task_statue('2', task_id)
+ post_server('task_close', task_id)
+
+
+# 初始化进度阶段
+def mig_modify_statue(task_id):
+ if not get_mig_state(task_id):
+ sql_mig_statue('00')
+ '''
+ else:
+ # Too many migration requests
+ # If you need to continue the migration, please change the task_data of the Mysql
+ return 1
+ ret = get_mig_state(task_id)
+ ret = re.sub('[0-9]', '0', ret[0]) + ret[1]
+ sql_mig_statue(ret)
+ # loggea
+ '''
\ No newline at end of file
--
2.20.1

View File

@ -1,6 +1,6 @@
Name: migration-tools
Version: 1.0.3
Release: 10
Release: 11
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
@ -17,6 +17,7 @@ Patch007: 0007-start-task-to-check-migration.patch
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
BuildArch: noarch
@ -116,6 +117,9 @@ rm -rf /usr/bin/migration-tools
%endif
%changelog
* Mon Nov 11 2024 xuezhixin <xuezhixin@uniontech.com> - 1.0.3-11
- 0011-initializate-the-migration-status.patch
* Mon Nov 11 2024 xuezhixin <xuezhixin@uniontech.com> - 1.0.3-10
- 0010-update-abi-result-to-database.patch