migration-tools/0036-add-an-interface-to-obtain-kernel-information.patch

47 lines
1.2 KiB
Diff

From b3450704f0ebc4092848a0764d888898a47cece7 Mon Sep 17 00:00:00 2001
From: lixin <lixinb@uniontech.com>
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