From 0a3d9035feeb67e10ac37b1c0926771d4fd64351 Mon Sep 17 00:00:00 2001 From: xuezhixin Date: Tue, 5 Nov 2024 20:48:21 +0800 Subject: [PATCH] add an interface to obtain kernrel information --- ...terface-to-obtain-kernel-information.patch | 46 +++++++++++++++++++ migration-tools.spec | 7 ++- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 0036-add-an-interface-to-obtain-kernel-information.patch diff --git a/0036-add-an-interface-to-obtain-kernel-information.patch b/0036-add-an-interface-to-obtain-kernel-information.patch new file mode 100644 index 0000000..bbaead4 --- /dev/null +++ b/0036-add-an-interface-to-obtain-kernel-information.patch @@ -0,0 +1,46 @@ +From b3450704f0ebc4092848a0764d888898a47cece7 Mon Sep 17 00:00:00 2001 +From: lixin +Date: Fri, 10 Nov 2023 14:02:24 +0800 +Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=86=85=E6=A0=B8=E6=95=B0?= + =?UTF-8?q?=E6=8D=AE=E6=8E=A5=E5=8F=A3?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + index.py | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/index.py b/index.py +index f0bf10d..f6a171f 100644 +--- a/index.py ++++ b/index.py +@@ -31,6 +31,7 @@ mods = { + 'delete_host_info': server.delete_host_info, + 'check_info': migration.check_info, + 'check_kernel': migration.check_kernel, ++ 'get_kernel_data': server.get_kernel_data, + } + + +@@ -110,6 +111,17 @@ def check_kernel(): + return Response(mod, content_type='application/json') + + ++@app.route('/get_kernel_data', methods=['GET', 'POST']) ++def get_kernel_data(): ++ """ ++ 获取系统内核和仓库内核版本 ++ :return: ++ """ ++ mod = check_methods() ++ if mod: ++ return Response(mod, content_type='application/json') ++ ++ + @app.route('/', methods=['GET', 'POST']) + def MT_index(): + """ +-- +2.20.1 + diff --git a/migration-tools.spec b/migration-tools.spec index d0ef181..d46d524 100644 --- a/migration-tools.spec +++ b/migration-tools.spec @@ -1,6 +1,6 @@ Name: migration-tools Version: 1.0.2 -Release: 35 +Release: 36 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 @@ -42,7 +42,7 @@ Patch32: 0032-add-migration.py-to-migration-function.patch Patch33: 0033-check-system-kernrel.patch Patch34: 0034-add-centos7-and-centos8-migration-interface.patch Patch35: 0035-the-migration-process-can-choose-not-to-migrate-the-kernel.patch - +Patch36: 0036-add-an-interface-to-obtain-kernel-information.patch BuildArch: noarch BuildRequires: systemd @@ -141,6 +141,9 @@ rm -rf /usr/bin/migration-tools %endif %changelog +* Tue Nov 5 2024 xuezhixin - 1.0.2-36 +- 0036-add-an-interface-to-obtain-kernel-information.patch + * Tue Nov 5 2024 xuezhixin - 1.0.2-35 - 0035-the-migration-process-can-choose-not-to-migrate-the-kernel.patch -- Gitee