346 lines
260 KiB
Diff
346 lines
260 KiB
Diff
|
|
From e7cb51995639db8f663af96a9da3211df5333eb5 Mon Sep 17 00:00:00 2001
|
||
|
|
From: lixin <lixinb@uniontech.com>
|
||
|
|
Date: Thu, 9 Nov 2023 15:40:32 +0800
|
||
|
|
Subject: [PATCH] =?UTF-8?q?=E5=B0=86func=E6=9B=BF=E6=8D=A2=E4=B8=BAagent?=
|
||
|
|
=?UTF-8?q?=E4=BB=A5=E4=BE=BF=E5=8C=BA=E5=88=86server=E4=B8=8Eagent?=
|
||
|
|
=?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD?=
|
||
|
|
MIME-Version: 1.0
|
||
|
|
Content-Type: text/plain; charset=UTF-8
|
||
|
|
Content-Transfer-Encoding: 8bit
|
||
|
|
|
||
|
|
---
|
||
|
|
client_requests.py | 2 +-
|
||
|
|
index.py | 2 +-
|
||
|
|
migration-tools-client.py | 4 ++--
|
||
|
|
start_webview.py | 2 +-
|
||
|
|
static/css/admin/jquery.min.map | 2 +-
|
||
|
|
{func => sysmig_agent}/7badpackage.txt | 0
|
||
|
|
{func => sysmig_agent}/8badpackage.txt | 0
|
||
|
|
{func => sysmig_agent}/Abisystmcompchk.sh | 0
|
||
|
|
{func => sysmig_agent}/Abitranrept.sh | 0
|
||
|
|
{func => sysmig_agent}/Abitxt2xls.py | 2 +-
|
||
|
|
{func => sysmig_agent}/centos72uos.sh | 0
|
||
|
|
{func => sysmig_agent}/centos82uos.py | 4 ++--
|
||
|
|
{func => sysmig_agent}/check.py | 20 ++++++++---------
|
||
|
|
{func => sysmig_agent}/kernel.sh | 0
|
||
|
|
{func => sysmig_agent}/share.py | 2 +-
|
||
|
|
{func => sysmig_agent}/utils.py | 0
|
||
|
|
uos-sysmig.sql | 26 +++++++++++++++++++++++
|
||
|
|
views/migration.py | 2 +-
|
||
|
|
views/server.py | 12 +++++++++++
|
||
|
|
19 files changed, 59 insertions(+), 21 deletions(-)
|
||
|
|
rename {func => sysmig_agent}/7badpackage.txt (100%)
|
||
|
|
rename {func => sysmig_agent}/8badpackage.txt (100%)
|
||
|
|
rename {func => sysmig_agent}/Abisystmcompchk.sh (100%)
|
||
|
|
rename {func => sysmig_agent}/Abitranrept.sh (100%)
|
||
|
|
rename {func => sysmig_agent}/Abitxt2xls.py (99%)
|
||
|
|
rename {func => sysmig_agent}/centos72uos.sh (100%)
|
||
|
|
rename {func => sysmig_agent}/centos82uos.py (99%)
|
||
|
|
rename {func => sysmig_agent}/check.py (97%)
|
||
|
|
rename {func => sysmig_agent}/kernel.sh (100%)
|
||
|
|
rename {func => sysmig_agent}/share.py (99%)
|
||
|
|
rename {func => sysmig_agent}/utils.py (100%)
|
||
|
|
|
||
|
|
diff --git a/client_requests.py b/client_requests.py
|
||
|
|
index 4069ea0..7f021c6 100644
|
||
|
|
--- a/client_requests.py
|
||
|
|
+++ b/client_requests.py
|
||
|
|
@@ -2,7 +2,7 @@
|
||
|
|
# SPDX-License-Identifier: MulanPubL-2.0-or-later
|
||
|
|
import json
|
||
|
|
import requests
|
||
|
|
-from func.share import getSysMigConf
|
||
|
|
+from sysmig_agent.share import getSysMigConf
|
||
|
|
|
||
|
|
|
||
|
|
uos_sysmig_conf = json.loads(getSysMigConf())
|
||
|
|
diff --git a/index.py b/index.py
|
||
|
|
index a505915..2cb89aa 100644
|
||
|
|
--- a/index.py
|
||
|
|
+++ b/index.py
|
||
|
|
@@ -6,7 +6,7 @@
|
||
|
|
import os
|
||
|
|
import sys
|
||
|
|
import json
|
||
|
|
-from func import share
|
||
|
|
+from sysmig_agent import share
|
||
|
|
from views import migration, server
|
||
|
|
|
||
|
|
from flask import Flask, render_template, url_for, request, redirect, make_response, session, Response
|
||
|
|
diff --git a/migration-tools-client.py b/migration-tools-client.py
|
||
|
|
index db94230..c1ca962 100644
|
||
|
|
--- a/migration-tools-client.py
|
||
|
|
+++ b/migration-tools-client.py
|
||
|
|
@@ -3,8 +3,8 @@
|
||
|
|
import os
|
||
|
|
import json
|
||
|
|
from flask import *
|
||
|
|
-from func import check
|
||
|
|
-from func.share import *
|
||
|
|
+from sysmig_agent import check
|
||
|
|
+from sysmig_agent.share import *
|
||
|
|
|
||
|
|
app = Flask(__name__)
|
||
|
|
|
||
|
|
diff --git a/start_webview.py b/start_webview.py
|
||
|
|
index 070182e..2bd3243 100755
|
||
|
|
--- a/start_webview.py
|
||
|
|
+++ b/start_webview.py
|
||
|
|
@@ -3,7 +3,7 @@
|
||
|
|
|
||
|
|
import webview
|
||
|
|
import json
|
||
|
|
-from func.share import getSysMigConf
|
||
|
|
+from sysmig_agent.share import getSysMigConf
|
||
|
|
|
||
|
|
uos_sysmig_conf = json.loads(getSysMigConf())
|
||
|
|
ip = json.loads(uos_sysmig_conf).get('serverip').strip()[1:-1]
|
||
|
|
diff --git a/static/css/admin/jquery.min.map b/static/css/admin/jquery.min.map
|
||
|
|
index 2529eaf..1a304ea 100644
|
||
|
|
--- a/static/css/admin/jquery.min.map
|
||
|
|
+++ b/static/css/admin/jquery.min.map
|
||
|
|
@@ -1 +1 @@
|
||
|
|
-{"version":3,"file":"jquery-2.1.1.min.js","sources":["jquery-2.1.1.js"],"names":["global","factory","module","exports","document","w","Error","window","this","noGlobal","arr","slice","concat","push","indexOf","class2type","toString","hasOwn","hasOwnProperty","support","version","jQuery","selector","context","fn","init","rtrim","rmsPrefix","rdashAlpha","fcamelCase","all","letter","toUpperCase","prototype","jquery","constructor","length","toArray","call","get","num","pushStack","elems","ret","merge","prevObject","each","callback","args","map","elem","i","apply","arguments","first","eq","last","len","j","end","sort","splice","extend","options","name","src","copy","copyIsArray","clone","target","deep","isFunction","isPlainObject","isArray","undefined","expando","Math","random","replace","isReady","error","msg","noop","obj","type","Array","isWindow","isNumeric","parseFloat","nodeType","isEmptyObject","globalEval","code","script","indirect","eval","trim","createElement","text","head","appendChild","parentNode","removeChild","camelCase","string","nodeName","toLowerCase","value","isArraylike","makeArray","results","Object","inArray","second","grep","invert","callbackInverse","matches","callbackExpect","arg","guid","proxy","tmp","now","Date","split","Sizzle","Expr","getText","isXML","tokenize","compile","select","outermostContext","sortInput","hasDuplicate","setDocument","docElem","documentIsHTML","rbuggyQSA","rbuggyMatches","contains","preferredDoc","dirruns","done","classCache","createCache","tokenCache","compilerCache","sortOrder","a","b","strundefined","MAX_NEGATIVE","pop","push_native","booleans","whitespace","characterEncoding","identifier","attributes","pseudos","RegExp","rcomma","rcombinators","rattributeQuotes","rpseudo","ridentifier","matchExpr","ID","CLASS","TAG","ATTR","PSEUDO","CHILD","bool","needsContext","rinputs","rheader","rnative","rquickExpr","rsibling","rescape","runescape","funescape","_","escaped","escapedWhitespace","high","String","fromCharCode","childNodes","e","els","seed","match","m","groups","old","nid","newContext","newSelector","ownerDocument","exec","getElementById","id","getElementsByTagName","getElementsByClassName","qsa","test","getAttribute","setAttribute","toSelector","testContext","join","querySelectorAll","qsaError","removeAttribute","keys","cache","key","cacheLength","shift","markFunction","assert","div","addHandle","attrs","handler","attrHandle","siblingCheck","cur","diff","sourceIndex","nextSibling","createInputPseudo","createButtonPseudo","createPositionalPseudo","argument","matchIndexes","documentElement","node","hasCompare","doc","parent","defaultView","top","addEventListener","attachEvent","className","createComment","innerHTML","firstChild","getById","getElementsByName","find","filter","attrId","getAttributeNode","tag","input","matchesSelector","webkitMatchesSelector","mozMatchesSelector","oMatchesSelector","msMatchesSelector","disconnectedMatch","compareDocumentPosition","adown","bup","compare","sortDetached","aup","ap","bp","unshift","expr","elements","attr","val","specified","uniqueSort","duplicates","detectDuplicates","sortStable","textContent","nodeValue","selectors","createPseudo","relative",">","dir"," ","+","~","preFilter","excess","unquoted","nodeNameSelector","pattern","operator","check","result","what","simple","forward","ofType","xml","outerCache","nodeIndex","start","useCache","lastChild","pseudo","setFilters","idx","matched","not","matcher","unmatched","has","innerText","lang","elemLang","hash","location","root","focus","activeElement","hasFocus","href","tabIndex","enabled","disabled","checked","selected","selectedIndex","empty","header","button","even","odd","lt","gt","radio","checkbox","file","password","image","submit","reset","filters","parseOnly","tokens","soFar","preFilters","cached","addCombinator","combinator","base","checkNonElements","doneName","oldCache","newCache","elementMatcher","matchers","multipleContexts","contexts","condense","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","temp","preMap","postMap","preexisting","matcherI
|
||
|
|
\ No newline at end of file
|
||
|
|
+{"version":3,"file":"jquery-2.1.1.min.js","sources":["jquery-2.1.1.js"],"names":["global","factory","module","exports","document","w","Error","window","this","noGlobal","arr","slice","concat","push","indexOf","class2type","toString","hasOwn","hasOwnProperty","support","version","jQuery","selector","context","fn","init","rtrim","rmsPrefix","rdashAlpha","fcamelCase","all","letter","toUpperCase","prototype","jquery","constructor","length","toArray","call","get","num","pushStack","elems","ret","merge","prevObject","each","callback","args","map","elem","i","apply","arguments","first","eq","last","len","j","end","sort","splice","extend","options","name","src","copy","copyIsArray","clone","target","deep","isFunction","isPlainObject","isArray","undefined","expando","Math","random","replace","isReady","error","msg","noop","obj","type","Array","isWindow","isNumeric","parseFloat","nodeType","isEmptyObject","globalEval","code","script","indirect","eval","trim","createElement","text","head","appendChild","parentNode","removeChild","camelCase","string","nodeName","toLowerCase","value","isArraylike","makeArray","results","Object","inArray","second","grep","invert","callbackInverse","matches","callbackExpect","arg","guid","proxy","tmp","now","Date","split","Sizzle","Expr","getText","isXML","tokenize","compile","select","outermostContext","sortInput","hasDuplicate","setDocument","docElem","documentIsHTML","rbuggyQSA","rbuggyMatches","contains","preferredDoc","dirruns","done","classCache","createCache","tokenCache","compilerCache","sortOrder","a","b","strundefined","MAX_NEGATIVE","pop","push_native","booleans","whitespace","characterEncoding","identifier","attributes","pseudos","RegExp","rcomma","rcombinators","rattributeQuotes","rpseudo","ridentifier","matchExpr","ID","CLASS","TAG","ATTR","PSEUDO","CHILD","bool","needsContext","rinputs","rheader","rnative","rquickExpr","rsibling","rescape","runescape","funescape","_","escaped","escapedWhitespace","high","String","fromCharCode","childNodes","e","els","seed","match","m","groups","old","nid","newContext","newSelector","ownerDocument","exec","getElementById","id","getElementsByTagName","getElementsByClassName","qsa","test","getAttribute","setAttribute","toSelector","testContext","join","querySelectorAll","qsaError","removeAttribute","keys","cache","key","cacheLength","shift","markFunction","assert","div","addHandle","attrs","handler","attrHandle","siblingCheck","cur","diff","sourceIndex","nextSibling","createInputPseudo","createButtonPseudo","createPositionalPseudo","argument","matchIndexes","documentElement","node","hasCompare","doc","parent","defaultView","top","addEventListener","attachEvent","className","createComment","innerHTML","firstChild","getById","getElementsByName","find","filter","attrId","getAttributeNode","tag","input","matchesSelector","webkitMatchesSelector","mozMatchesSelector","oMatchesSelector","msMatchesSelector","disconnectedMatch","compareDocumentPosition","adown","bup","compare","sortDetached","aup","ap","bp","unshift","expr","elements","attr","val","specified","uniqueSort","duplicates","detectDuplicates","sortStable","textContent","nodeValue","selectors","createPseudo","relative",">","dir"," ","+","~","preFilter","excess","unquoted","nodeNameSelector","pattern","operator","check","result","what","simple","forward","ofType","xml","outerCache","nodeIndex","start","useCache","lastChild","pseudo","setFilters","idx","matched","not","matcher","unmatched","has","innerText","lang","elemLang","hash","location","root","focus","activeElement","hasFocus","href","tabIndex","enabled","disabled","checked","selected","selectedIndex","empty","header","button","even","odd","lt","gt","radio","checkbox","file","password","image","submit","reset","filters","parseOnly","tokens","soFar","preFilters","cached","addCombinator","combinator","base","checkNonElements","doneName","oldCache","newCache","elementMatcher","matchers","multipleContexts","contexts","condense","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","temp","preMap","postMap","preexisting","matcherI
|
||
|
|
\ No newline at end of file
|
||
|
|
diff --git a/func/7badpackage.txt b/sysmig_agent/7badpackage.txt
|
||
|
|
similarity index 100%
|
||
|
|
rename from func/7badpackage.txt
|
||
|
|
rename to sysmig_agent/7badpackage.txt
|
||
|
|
diff --git a/func/8badpackage.txt b/sysmig_agent/8badpackage.txt
|
||
|
|
similarity index 100%
|
||
|
|
rename from func/8badpackage.txt
|
||
|
|
rename to sysmig_agent/8badpackage.txt
|
||
|
|
diff --git a/func/Abisystmcompchk.sh b/sysmig_agent/Abisystmcompchk.sh
|
||
|
|
similarity index 100%
|
||
|
|
rename from func/Abisystmcompchk.sh
|
||
|
|
rename to sysmig_agent/Abisystmcompchk.sh
|
||
|
|
diff --git a/func/Abitranrept.sh b/sysmig_agent/Abitranrept.sh
|
||
|
|
similarity index 100%
|
||
|
|
rename from func/Abitranrept.sh
|
||
|
|
rename to sysmig_agent/Abitranrept.sh
|
||
|
|
diff --git a/func/Abitxt2xls.py b/sysmig_agent/Abitxt2xls.py
|
||
|
|
similarity index 99%
|
||
|
|
rename from func/Abitxt2xls.py
|
||
|
|
rename to sysmig_agent/Abitxt2xls.py
|
||
|
|
index d80ad4c..f676cf9 100644
|
||
|
|
--- a/func/Abitxt2xls.py
|
||
|
|
+++ b/sysmig_agent/Abitxt2xls.py
|
||
|
|
@@ -5,7 +5,7 @@ import datetime
|
||
|
|
import json
|
||
|
|
import socket
|
||
|
|
import xlwt
|
||
|
|
-from func.share import *
|
||
|
|
+from sysmig_agent.share import *
|
||
|
|
|
||
|
|
|
||
|
|
report_path_bef = "/var/tmp/uos-migration/UOS_analysis_report/"
|
||
|
|
diff --git a/func/centos72uos.sh b/sysmig_agent/centos72uos.sh
|
||
|
|
similarity index 100%
|
||
|
|
rename from func/centos72uos.sh
|
||
|
|
rename to sysmig_agent/centos72uos.sh
|
||
|
|
diff --git a/func/centos82uos.py b/sysmig_agent/centos82uos.py
|
||
|
|
similarity index 99%
|
||
|
|
rename from func/centos82uos.py
|
||
|
|
rename to sysmig_agent/centos82uos.py
|
||
|
|
index 04d5a12..0a715b0 100755
|
||
|
|
--- a/func/centos82uos.py
|
||
|
|
+++ b/sysmig_agent/centos82uos.py
|
||
|
|
@@ -44,12 +44,12 @@ def get_bad_packages():
|
||
|
|
local_os_version = version[0]
|
||
|
|
badpackages = ''
|
||
|
|
if '8' == local_os_version:
|
||
|
|
- with open('func/8badpackage.txt','r') as bf:
|
||
|
|
+ with open('sysmig_agent/8badpackage.txt','r') as bf:
|
||
|
|
for bad_package in bf:
|
||
|
|
badpackages = badpackages + ' ' + bad_package.strip()
|
||
|
|
bf.close()
|
||
|
|
else:
|
||
|
|
- with open('func/7badpackage.txt','r') as bf:
|
||
|
|
+ with open('sysmig_agent/7badpackage.txt','r') as bf:
|
||
|
|
for bad_package in bf:
|
||
|
|
badpackages = badpackages + ' ' + bad_package.strip()
|
||
|
|
bf.close()
|
||
|
|
diff --git a/func/check.py b/sysmig_agent/check.py
|
||
|
|
similarity index 97%
|
||
|
|
rename from func/check.py
|
||
|
|
rename to sysmig_agent/check.py
|
||
|
|
index 47de418..3d4d3e9 100644
|
||
|
|
--- a/func/check.py
|
||
|
|
+++ b/sysmig_agent/check.py
|
||
|
|
@@ -12,9 +12,9 @@ from multiprocessing import Process
|
||
|
|
|
||
|
|
|
||
|
|
from settings import *
|
||
|
|
-from func.utils import *
|
||
|
|
-from func.share import *
|
||
|
|
-from func.Abitxt2xls import *
|
||
|
|
+from sysmig_agent.utils import *
|
||
|
|
+from sysmig_agent.share import *
|
||
|
|
+from sysmig_agent.Abitxt2xls import *
|
||
|
|
|
||
|
|
os.chdir('/usr/lib/migration-tools-agent')
|
||
|
|
|
||
|
|
@@ -375,7 +375,7 @@ def fork_sh(cmd):
|
||
|
|
|
||
|
|
|
||
|
|
def env():
|
||
|
|
- cmd = 'sh func/Abisystmcompchk.sh'
|
||
|
|
+ cmd = 'sh sysmig_agent/Abisystmcompchk.sh'
|
||
|
|
t = Process(target=fork_sh, args=(cmd,))
|
||
|
|
t.start()
|
||
|
|
|
||
|
|
@@ -603,21 +603,21 @@ def Sysmig(data_j):
|
||
|
|
AGENT_OS = os_version_ret[0]+version[0]
|
||
|
|
kernel_version = json.loads(data_j).get('kernel_version')
|
||
|
|
if re.fullmatch('8',version[0]):
|
||
|
|
- cmd = 'python3 func/centos82uos.py'
|
||
|
|
+ cmd = 'python3 sysmig_agent/centos82uos.py'
|
||
|
|
t = Process(target=run_cmd2file, args=(cmd,))
|
||
|
|
t.start()
|
||
|
|
elif re.search('centos7',AGENT_OS):
|
||
|
|
- ex_kernel = 'sh func/centos72uos.sh -e "kernel-devel* kernel-headers* kernel-tools* kernel* bpftool perf python-perf kernel-abi* kernel-modules kernel-core kmod-kvdo"'
|
||
|
|
+ ex_kernel = 'sh sysmig_agent/centos72uos.sh -e "kernel-devel* kernel-headers* kernel-tools* kernel* bpftool perf python-perf kernel-abi* kernel-modules kernel-core kmod-kvdo"'
|
||
|
|
if kernel_version == '0':
|
||
|
|
run_cmd2file(ex_kernel)
|
||
|
|
messageState('3')
|
||
|
|
elif kernel_version == '3.10.0' :
|
||
|
|
run_cmd2file(ex_kernel)
|
||
|
|
- cmd_k = 'sh func/kernel.sh -k 3.10.0'
|
||
|
|
+ cmd_k = 'sh sysmig_agent/kernel.sh -k 3.10.0'
|
||
|
|
run_cmd2file(cmd_k)
|
||
|
|
messageState('3')
|
||
|
|
else:
|
||
|
|
- cmd = 'sh func/centos72uos.sh'
|
||
|
|
+ cmd = 'sh sysmig_agent/centos72uos.sh'
|
||
|
|
run_cmd2file(cmd)
|
||
|
|
messageState('3')
|
||
|
|
|
||
|
|
@@ -647,7 +647,7 @@ def system_migration(data_j):
|
||
|
|
oldos = oldos.split(':',1)
|
||
|
|
main_conf(oldos[1])
|
||
|
|
if os.path.exists('/var/tmp/uos-migration/data/exp-rst/systeminfo.txt'):
|
||
|
|
- run_cmd2file('sh func/Abitranrept.sh')
|
||
|
|
+ run_cmd2file('sh sysmig_agent/Abitranrept.sh')
|
||
|
|
abi_txt2xls_after_mig()
|
||
|
|
messageState('4')
|
||
|
|
elif re.fullmatch('4',state):
|
||
|
|
@@ -659,7 +659,7 @@ def system_migration(data_j):
|
||
|
|
elif re.fullmatch('3',state):
|
||
|
|
messageState('5')
|
||
|
|
if os.path.exists('/var/tmp/uos-migration/data/exp-rst/systeminfo.txt'):
|
||
|
|
- run_cmd2file('func/Abitranrept.sh')
|
||
|
|
+ run_cmd2file('sysmig_agent/Abitranrept.sh')
|
||
|
|
abi_txt2xls_after_mig()
|
||
|
|
if os.path.exists('/var/tmp/uos-migration/UOS_migration_log/rpms-list-after.txt'):
|
||
|
|
res = '0'
|
||
|
|
diff --git a/func/kernel.sh b/sysmig_agent/kernel.sh
|
||
|
|
similarity index 100%
|
||
|
|
rename from func/kernel.sh
|
||
|
|
rename to sysmig_agent/kernel.sh
|
||
|
|
diff --git a/func/share.py b/sysmig_agent/share.py
|
||
|
|
similarity index 99%
|
||
|
|
rename from func/share.py
|
||
|
|
rename to sysmig_agent/share.py
|
||
|
|
index 6ad5749..ec9265b 100644
|
||
|
|
--- a/func/share.py
|
||
|
|
+++ b/sysmig_agent/share.py
|
||
|
|
@@ -8,7 +8,7 @@ import re
|
||
|
|
import shutil
|
||
|
|
import subprocess
|
||
|
|
|
||
|
|
-from func.utils import list_to_json
|
||
|
|
+from sysmig_agent.utils import list_to_json
|
||
|
|
|
||
|
|
def getSysMigConf():
|
||
|
|
confpath = '/etc/migration-tools/migration-tools.conf'
|
||
|
|
diff --git a/func/utils.py b/sysmig_agent/utils.py
|
||
|
|
similarity index 100%
|
||
|
|
rename from func/utils.py
|
||
|
|
rename to sysmig_agent/utils.py
|
||
|
|
diff --git a/uos-sysmig.sql b/uos-sysmig.sql
|
||
|
|
index d65006d..4a33bb0 100644
|
||
|
|
--- a/uos-sysmig.sql
|
||
|
|
+++ b/uos-sysmig.sql
|
||
|
|
@@ -80,6 +80,32 @@ LOCK TABLES `task_stream` WRITE;
|
||
|
|
/*!40000 ALTER TABLE `task_stream` ENABLE KEYS */;
|
||
|
|
UNLOCK TABLES;
|
||
|
|
|
||
|
|
+--
|
||
|
|
+-- Table structure for table `cur_task`
|
||
|
|
+--
|
||
|
|
+
|
||
|
|
+DROP TABLE IF EXISTS `cur_task`;
|
||
|
|
+/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||
|
|
+/*!50503 SET character_set_client = utf8mb4 */;
|
||
|
|
+CREATE TABLE `cur_task` (
|
||
|
|
+ `task_id` int NOT NULL AUTO_INCREMENT,
|
||
|
|
+ `task_status` varchar(256) DEFAULT NULL,
|
||
|
|
+ `stream_CreateTime` timestamp NULL DEFAULT NULL,
|
||
|
|
+ `stream_Updatetime` varchar(45) DEFAULT NULL,
|
||
|
|
+ `agent_ip` varchar(256) DEFAULT NULL,
|
||
|
|
+ PRIMARY KEY (`task_id`)
|
||
|
|
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||
|
|
+/*!40101 SET character_set_client = @saved_cs_client */;
|
||
|
|
+
|
||
|
|
+--
|
||
|
|
+-- Dumping data for table `cur_task`
|
||
|
|
+--
|
||
|
|
+
|
||
|
|
+LOCK TABLES `cur_task` WRITE;
|
||
|
|
+/*!40000 ALTER TABLE `cur_task` DISABLE KEYS */;
|
||
|
|
+/*!40000 ALTER TABLE `cur_task` ENABLE KEYS */;
|
||
|
|
+UNLOCK TABLES;
|
||
|
|
+
|
||
|
|
--
|
||
|
|
-- Dumping routines for database 'uossysmig'
|
||
|
|
--
|
||
|
|
diff --git a/views/migration.py b/views/migration.py
|
||
|
|
index 477627b..f9fe01d 100644
|
||
|
|
--- a/views/migration.py
|
||
|
|
+++ b/views/migration.py
|
||
|
|
@@ -3,7 +3,7 @@
|
||
|
|
import os
|
||
|
|
from flask import *
|
||
|
|
from client_requests import *
|
||
|
|
-from func.utils import *
|
||
|
|
+from sysmig_agent.utils import *
|
||
|
|
|
||
|
|
|
||
|
|
def check_services(data, url):
|
||
|
|
diff --git a/views/server.py b/views/server.py
|
||
|
|
index d36f013..49353b4 100644
|
||
|
|
--- a/views/server.py
|
||
|
|
+++ b/views/server.py
|
||
|
|
@@ -2,6 +2,7 @@ import json
|
||
|
|
from datetime import datetime
|
||
|
|
|
||
|
|
from connect_sql import DBHelper
|
||
|
|
+from sysmig_agent.share import getSysMigConf
|
||
|
|
|
||
|
|
def import_host_info(data):
|
||
|
|
"""
|
||
|
|
@@ -23,7 +24,18 @@ def import_host_info(data):
|
||
|
|
agent_passwd = i.get('agent_password')
|
||
|
|
val = ((agent_ip, agent_username, agent_passwd),)
|
||
|
|
DBHelper().insert(sql, val)
|
||
|
|
+ create_task_stream(agent_ip)
|
||
|
|
|
||
|
|
+ time = datetime.now().strftime('%Y-%-m-%d %H:%M:%S')
|
||
|
|
+ uos_sysmig_conf = json.loads(getSysMigConf())
|
||
|
|
+ ip = json.loads(uos_sysmig_conf).get('serverip').strip()[1:-1]
|
||
|
|
+ host_report_sql = "insert into report_info(agent_ip,create_time,report_name,report_type) values (%s, %s, %s, %s);"
|
||
|
|
+ host_report_sql_val = ((ip, time, '迁移主机列表_%s' % time, '主机列表'),)
|
||
|
|
+ DBHelper().insert(host_report_sql, host_report_sql_val)
|
||
|
|
+ # TODO: 用户权限检测
|
||
|
|
+
|
||
|
|
+ data_json = json.dumps(data)
|
||
|
|
+ return data_json
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
2.20.1
|
||
|
|
|