!96 process os version and os name

From: @xuezhizone 
Reviewed-by: @xingwei-liu 
Signed-off-by: @xingwei-liu
This commit is contained in:
openeuler-ci-bot 2024-11-06 02:21:06 +00:00 committed by Gitee
commit 302846cee5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,38 @@
From 1683b7dbd84ce4bdc399d3da731c9c5b22ed07fe Mon Sep 17 00:00:00 2001
From: xuezhixin <xuezhixin@uniontech.com>
Date: Fri, 10 Nov 2023 14:33:19 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E7=B3=BB=E7=BB=9F=E7=89=88?=
=?UTF-8?q?=E6=9C=AC=E5=92=8C=E7=B3=BB=E7=BB=9F=E5=90=8D=E7=A7=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sysmig_agent/migration.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/sysmig_agent/migration.py b/sysmig_agent/migration.py
index ebee24d..fec143a 100644
--- a/sysmig_agent/migration.py
+++ b/sysmig_agent/migration.py
@@ -221,3 +221,17 @@ def get_old_osnameversion():
return str(state)
except:
return None
+
+
+def get_old_osname():
+ nv = get_old_osnameversion()
+ oldosname = re.sub(r'[0-9]', '', nv)
+ return oldosname
+
+
+def get_old_osversion():
+ nv = get_old_osnameversion()
+ oldosversion = re.sub(r'[A-Z,a-z]', '', nv)
+ return oldosversion
+
+
--
2.20.1

View File

@ -1,6 +1,6 @@
Name: migration-tools
Version: 1.0.2
Release: 42
Release: 43
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
@ -49,6 +49,8 @@ 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
Patch43: 0043-process-os-version-and-os-name.patch
BuildArch: noarch
BuildRequires: systemd
@ -147,6 +149,9 @@ rm -rf /usr/bin/migration-tools
%endif
%changelog
* Tue Nov 5 2024 xuezhixin <xuezhixin@uniontech.com> - 1.0.2-43
- 0043-process-os-version-and-os-name.patch
* Tue Nov 5 2024 xuezhixin <xuezhixin@uniontech.com> - 1.0.2-42
- 0042-get-initial-os-version-from-agent_info-interface.patch