!70 add process data in database

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

View File

@ -0,0 +1,42 @@
From a3b140660e4180fdeddc7d2bb8009a78218a9235 Mon Sep 17 00:00:00 2001
From: xuezhixin <xuezhixin@uniontech.com>
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

View File

@ -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 <xuezhixin@uniontech.com> - 1.0.2-17
- 0017-add-process-data-in-database.patch
* Mon Nov 4 2024 xuezhixin <xuezhixin@uniontech.com> - 1.0.2-16
- 0016-get-local-ip-on-the-agent.patch