diff --git a/0045-modify-repository-file.patch b/0045-modify-repository-file.patch new file mode 100644 index 0000000000000000000000000000000000000000..027c19b825e8f2404a5c89e88706c654ad99df42 --- /dev/null +++ b/0045-modify-repository-file.patch @@ -0,0 +1,80 @@ +From 481d09eba9e03bda1d87fc9d21451634d23fff30 Mon Sep 17 00:00:00 2001 +From: lixin +Date: Fri, 10 Nov 2023 14:47:54 +0800 +Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9repo=E6=A3=80=E6=B5=8B?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + index.py | 13 ++++++++++++- + views/migration.py | 15 ++++++++++++--- + 2 files changed, 24 insertions(+), 4 deletions(-) + +diff --git a/index.py b/index.py +index f6a171f..9665e29 100644 +--- a/index.py ++++ b/index.py +@@ -18,7 +18,6 @@ mods = { + 'check_os_kernel': migration.check_os_kernel, + 'check_migration_progress': migration.check_migration_progress, + 'check_progress': migration.check_progress, +- 'check_repo': migration.check_repo, + 'check_repo_kernel': migration.check_repo_kernel, + 'check_user': migration.check_user, + 'close_tool': migration.close_tool, +@@ -32,6 +31,7 @@ mods = { + 'check_info': migration.check_info, + 'check_kernel': migration.check_kernel, + 'get_kernel_data': server.get_kernel_data, ++ 'check_repo': migration.check_repo, + } + + +@@ -122,6 +122,17 @@ def get_kernel_data(): + return Response(mod, content_type='application/json') + + ++@app.route('/check_repo', methods=['GET', 'POST']) ++def check_repo(): ++ """ ++ 检测平台软件仓库 ++ :return: ++ """ ++ mod = check_methods() ++ if mod: ++ return Response(mod, content_type='application/json') ++ ++ + @app.route('/', methods=['GET', 'POST']) + def MT_index(): + """ +diff --git a/views/migration.py b/views/migration.py +index d9ac551..a628694 100644 +--- a/views/migration.py ++++ b/views/migration.py +@@ -123,9 +123,18 @@ def check_user(data): + + + def check_repo(data): +- services = check_services(data, '/check_repo') +- if services: +- return services ++ """ ++ 检测平台软件仓库 ++ :param data: ++ :return: ++ """ ++ sql = "select agent_ip from agent_info where agent_online_status = 0 and agent_storage >= 10;" ++ agent_ip_list = DBHelper().execute(sql) ++ for i in agent_ip_list: ++ repo_status_sql = "update agent_info set repo_status='2' where agent_ip='%s'" % list(i)[0] ++ DBHelper().execute(repo_status_sql) ++ get_agent_ip(data, sql, '/check_repo') ++ return 'success' + + + def check_os_kernel(data): +-- +2.20.1 + diff --git a/migration-tools.spec b/migration-tools.spec index 85b7a8aceff27506301b07bb2cbebb28e0806cb8..c675760b7db2fb81888ae8d935d4db6b0331382d 100644 --- a/migration-tools.spec +++ b/migration-tools.spec @@ -1,6 +1,6 @@ Name: migration-tools Version: 1.0.2 -Release: 44 +Release: 45 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 @@ -51,6 +51,7 @@ 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 Patch44: 0044-migrate-in-myutiple-steps.patch +Patch45: 0045-modify-repository-file.patch BuildArch: noarch BuildRequires: systemd @@ -149,6 +150,9 @@ rm -rf /usr/bin/migration-tools %endif %changelog +* Tue Nov 5 2024 xuezhixin - 1.0.2-45 +- 0045-modify-repository-file.patch + * Tue Nov 5 2024 xuezhixin - 1.0.2-44 - 0044-migrate-in-myutiple-steps.patch