From 06b43801bd4d25e263a71cc59302f2c94972e160 Mon Sep 17 00:00:00 2001 From: xuezhixin Date: Mon, 4 Nov 2024 15:59:13 +0800 Subject: [PATCH] add process data in database --- 0017-add-process-data-in-database.patch | 42 +++++++++++++++++++++++++ migration-tools.spec | 7 +++-- 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 0017-add-process-data-in-database.patch diff --git a/0017-add-process-data-in-database.patch b/0017-add-process-data-in-database.patch new file mode 100644 index 0000000..72285b1 --- /dev/null +++ b/0017-add-process-data-in-database.patch @@ -0,0 +1,42 @@ +From a3b140660e4180fdeddc7d2bb8009a78218a9235 Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Fri, 10 Nov 2023 10:21:12 +0800 +Subject: [PATCH] =?UTF-8?q?agent=E5=A2=9E=E5=8A=A0=E4=BB=BB=E5=8A=A1?= + =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=9B=B4=E6=96=B0=E6=95=B0=E6=8D=AE=E5=BA=93?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/share.py | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/sysmig_agent/share.py b/sysmig_agent/share.py +index ea3d63a..aae815c 100644 +--- a/sysmig_agent/share.py ++++ b/sysmig_agent/share.py +@@ -9,7 +9,7 @@ import shutil + import subprocess + import socket + from sysmig_agent.utils import list_to_json +- ++from connect_sql import DBHelper + + def get_local_ip(): + try: +@@ -20,6 +20,12 @@ def get_local_ip(): + finally: + s.close() + ++def sql_abi_progress(data): ++ sql = "UPDATE agent_task SET task_progress = {} ,task_Updatetime = NOW() WHERE agent_ip = '{}';".format(data, get_local_ip()) ++ try: ++ ret = DBHelper().execute(sql) ++ except: ++ pass + + def getSysMigConf(): + confpath = '/etc/migration-tools/migration-tools.conf' +-- +2.20.1 + diff --git a/migration-tools.spec b/migration-tools.spec index d3840b0..e44d9c6 100644 --- a/migration-tools.spec +++ b/migration-tools.spec @@ -1,6 +1,6 @@ Name: migration-tools Version: 1.0.2 -Release: 16 +Release: 17 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 @@ -23,7 +23,7 @@ Patch13: 0013-display-agent-host-information.patch Patch14: 0014-modify-task-stream-interface.patch Patch15: 0015-delete-host-information-interface.patch Patch16: 0016-get-local-ip-on-the-agent.patch - +Patch17: 0017-add-process-data-in-database.patch BuildArch: noarch BuildRequires: systemd %description @@ -121,6 +121,9 @@ rm -rf /usr/bin/migration-tools %endif %changelog +* Mon Nov 4 2024 xuezhixin - 1.0.2-17 +- 0017-add-process-data-in-database.patch + * Mon Nov 4 2024 xuezhixin - 1.0.2-16 - 0016-get-local-ip-on-the-agent.patch -- Gitee