get agent ip interface
This commit is contained in:
parent
771c0d4cb1
commit
9a448d0049
45
0021-get-agent-ip-interface.patch
Normal file
45
0021-get-agent-ip-interface.patch
Normal file
@ -0,0 +1,45 @@
|
||||
From 371237696acb7ea7c34191cd629f3dd8d9cff8df Mon Sep 17 00:00:00 2001
|
||||
From: lixin <lixinb@uniontech.com>
|
||||
Date: Fri, 10 Nov 2023 10:32:24 +0800
|
||||
Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96agent=20ip=E5=9C=B0=E5=9D=80?=
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
---
|
||||
views/migration.py | 19 +++++++++++++++++++
|
||||
1 file changed, 19 insertions(+)
|
||||
|
||||
diff --git a/views/migration.py b/views/migration.py
|
||||
index b359d36..7b2f4ed 100644
|
||||
--- a/views/migration.py
|
||||
+++ b/views/migration.py
|
||||
@@ -10,6 +10,25 @@ from client_requests import *
|
||||
from sysmig_agent.utils import *
|
||||
|
||||
|
||||
+def get_agent_ip(data, sql, url):
|
||||
+ """
|
||||
+ 获取agent_ip地址
|
||||
+ :return:
|
||||
+ """
|
||||
+ agent_info = DBHelper().execute(sql).fetchall()
|
||||
+ data = json.loads(data)
|
||||
+ for i in agent_info:
|
||||
+ task_status_sql = "select task_status from agent_task where agent_ip='%s'" % list(i)[0]
|
||||
+ task_status = DBHelper().execute(task_status_sql).fetchall()[0][0]
|
||||
+ if task_status == 0 or task_status == 2:
|
||||
+ update_sql = "update agent_task set task_progress=0,task_status=1 where agent_ip='%s'" % list(i)[0]
|
||||
+ DBHelper().execute(update_sql)
|
||||
+ get_task_id_sql = "select task_id from cur_task where agent_ip='%s'" % list(i)[0]
|
||||
+ task_id = DBHelper().execute(get_task_id_sql).fetchall()
|
||||
+ data['task_id'] = task_id[0][0]
|
||||
+ json_data = json.dumps(data)
|
||||
+
|
||||
+
|
||||
def check_info(data):
|
||||
"""
|
||||
检测系统版本和空间大小
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Name: migration-tools
|
||||
Version: 1.0.2
|
||||
Release: 20
|
||||
Release: 21
|
||||
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
|
||||
@ -27,7 +27,7 @@ Patch17: 0017-add-process-data-in-database.patch
|
||||
Patch18: 0018-detection-of-imported-host-information-interface.patch
|
||||
Patch19: 0019-update-abi-result-to-database.patch
|
||||
Patch20: 0020-get-task-process-and-migration-stage-information.patch
|
||||
|
||||
Patch21: 0021-get-agent-ip-interface.patch
|
||||
BuildArch: noarch
|
||||
BuildRequires: systemd
|
||||
%description
|
||||
@ -125,6 +125,9 @@ rm -rf /usr/bin/migration-tools
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Mon Nov 4 2024 xuezhixin <xuezhixin@uniontech.com> - 1.0.2-21
|
||||
- 0021-get-agent-ip-interface.patch
|
||||
|
||||
* Mon Nov 4 2024 xuezhixin <xuezhixin@uniontech.com> - 1.0.2-20
|
||||
- 0020-get-task-process-and-migration-stage-information.patch
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user