diff --git a/0042-get-initial-os-version-from-agent_info-interface.patch b/0042-get-initial-os-version-from-agent_info-interface.patch new file mode 100644 index 0000000000000000000000000000000000000000..b77b1cd923f81c844f0cab4f7a0182bd844bb117 --- /dev/null +++ b/0042-get-initial-os-version-from-agent_info-interface.patch @@ -0,0 +1,35 @@ +From 8dbb02f7ffc89e6e5f3a634dac500b197028124d Mon Sep 17 00:00:00 2001 +From: xuezhixin +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 + diff --git a/migration-tools.spec b/migration-tools.spec index e59b801f5a123a8eccfa90b0f9ff72025202c047..c3e4938eec74f85d1c3825edbe5f2d30e53ca84f 100644 --- a/migration-tools.spec +++ b/migration-tools.spec @@ -1,6 +1,6 @@ Name: migration-tools Version: 1.0.2 -Release: 41 +Release: 42 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 @@ -48,7 +48,7 @@ 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 - +Patch42: 0042-get-initial-os-version-from-agent_info-interface.patch BuildArch: noarch BuildRequires: systemd @@ -147,6 +147,9 @@ rm -rf /usr/bin/migration-tools %endif %changelog +* Tue Nov 5 2024 xuezhixin - 1.0.2-42 +- 0042-get-initial-os-version-from-agent_info-interface.patch + * Tue Nov 5 2024 xuezhixin - 1.0.2-41 - 0041-get-migration-status-from-database.patch