diff --git a/0041-get-migration-status-from-database.patch b/0041-get-migration-status-from-database.patch new file mode 100644 index 0000000000000000000000000000000000000000..39453d8f3284424a50df3043b4052e00c6aa871b --- /dev/null +++ b/0041-get-migration-status-from-database.patch @@ -0,0 +1,33 @@ +From ec7c2d5065e3aeab507bcc4f10e667e7712df201 Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Fri, 10 Nov 2023 14:21:06 +0800 +Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=95=B0=E6=8D=AE=E5=BA=93?= + =?UTF-8?q?=E8=BF=81=E7=A7=BB=E4=BB=BB=E5=8A=A1=E7=8A=B6=E6=80=81?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/migration.py | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/sysmig_agent/migration.py b/sysmig_agent/migration.py +index ef78ed8..6dddb7b 100644 +--- a/sysmig_agent/migration.py ++++ b/sysmig_agent/migration.py +@@ -201,3 +201,12 @@ def init_log_dir(): + migInit_porgress() + + ++def get_mig_state(task_id): ++ sql = "SELECT task_data FROM agent_task WHERE task_id = {} ;".format(task_id) ++ ret_sql_msg_info = DBHelper().execute(sql) ++ try: ++ state = ret_sql_msg_info.fetchall()[0][0] ++ if len(state): ++ return str(state) ++ except: ++ return None +-- +2.20.1 + diff --git a/migration-tools.spec b/migration-tools.spec index 9e6feed7015775d04da137d8d9a499af2452e377..e59b801f5a123a8eccfa90b0f9ff72025202c047 100644 --- a/migration-tools.spec +++ b/migration-tools.spec @@ -1,6 +1,6 @@ Name: migration-tools Version: 1.0.2 -Release: 40 +Release: 41 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 @@ -47,6 +47,8 @@ Patch37: 0037-add-subprocess-function-and-loggin.patch Patch38: 0038-obtain-kernel-data.patch Patch39: 0039-repository-file-choose-kernel-version-to-migration.patch Patch40: 0040-intial-logfile-and-tmpfile.patch +Patch41: 0041-get-migration-status-from-database.patch + BuildArch: noarch BuildRequires: systemd @@ -145,6 +147,9 @@ rm -rf /usr/bin/migration-tools %endif %changelog +* Tue Nov 5 2024 xuezhixin - 1.0.2-41 +- 0041-get-migration-status-from-database.patch + * Tue Nov 5 2024 xuezhixin - 1.0.2-40 - 0040-intial-logfile-and-tmpfile.patch