From 8dbb02f7ffc89e6e5f3a634dac500b197028124d Mon Sep 17 00:00:00 2001
From: xuezhixin <xuezhixin@uniontech.com>
Date: Fri, 10 Nov 2023 14:24:51 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BB=8Eagent=5Finfo=E8=8E=B7=E5=8F=96?=
 =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E7=B3=BB=E7=BB=9F=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 sysmig_agent/migration.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sysmig_agent/migration.py b/sysmig_agent/migration.py
index 6dddb7b..ebee24d 100644
--- a/sysmig_agent/migration.py
+++ b/sysmig_agent/migration.py
@@ -210,3 +210,14 @@ def get_mig_state(task_id):
             return str(state)
     except:
         return None
+
+
+def get_old_osnameversion():
+    sql = "SELECT agent_os FROM agent_info WHERE agent_ip = '{}' ;".format(get_local_ip())
+    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

