From ec7c2d5065e3aeab507bcc4f10e667e7712df201 Mon Sep 17 00:00:00 2001
From: xuezhixin <xuezhixin@uniontech.com>
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

