diff --git a/index.py b/index.py index 2a74e8a82e2e9d139a1aeca2317a63ea1840b813..8c4da040cc47ee0ba78ff73cfc839c79ff5a4a89 100644 --- a/index.py +++ b/index.py @@ -5,7 +5,7 @@ import os import json from flask import Flask, render_template, url_for, request, redirect, make_response, session, Response -os.chdir('/usr/lib/uos-sysmig-server') +os.chdir('/usr/lib/migration-tools-server') from connect_sql import * from logger import * from sysmig_agent.share import getSysMigConf @@ -14,14 +14,12 @@ from views.migration import * from views.server import * from flask_cors import CORS - # import MySQLdb -os.chdir('/usr/lib/uos-sysmig-server') +os.chdir('/usr/lib/migration-tools-server') app = Flask(__name__) migration_log = Logger('/var/tmp/uos-migration/migration.log', logging.DEBUG, logging.DEBUG) CORS(app, resources=r'/*') - mods = { 'import_host_info': import_host_info, 'host_info_display': host_info_display, @@ -47,7 +45,6 @@ mods = { 'modify_task_status': modify_task_status } - def check_methods(): if request.method == 'POST': data = request.get_data() diff --git a/migration-tools.spec b/migration-tools.spec index 6e192de361a80f98fe7574d7e87ca55423382a42..133373baf31e88de2ebb0d285eedca9bdae2e2bb 100644 --- a/migration-tools.spec +++ b/migration-tools.spec @@ -54,7 +54,7 @@ mkdir -p $RPM_BUILD_ROOT/etc/migration-tools cp -r ut-Migration-tools/* $RPM_BUILD_ROOT/usr/lib/migration-tools-server/ # Install server config -%{__cp} -r $RPM_BUILD_ROOT/usr/lib/migration-tools-server/server/migration-tools-server.service $RPM_BUILD_ROOT/etc/migration-tools +%{__cp} -r $RPM_BUILD_ROOT/usr/lib/migration-tools-server/server/migration-tools.conf $RPM_BUILD_ROOT/etc/migration-tools %post -n migration-tools-server diff --git a/uos-sysmig/mig_merge/stock_replace/confirm.py b/uos-sysmig/mig_merge/stock_replace/confirm.py index 5009f382221ed8ba0e2450566c0ff6365b990748..34ac9ff9f0d8c48a36de7761e990d70a936a97ad 100644 --- a/uos-sysmig/mig_merge/stock_replace/confirm.py +++ b/uos-sysmig/mig_merge/stock_replace/confirm.py @@ -58,6 +58,11 @@ def get_cur_sys_version(): 输入参数:无 返 回 值:CentOS Linux 8 (Core) ''' + + if not os.path.exists('/etc/os-release'): + print("Please CHECK /etc/os-release WHETHER EXIT!!!") + return "-1" + fp = open('/etc/os-release', 'r') for line in fp: if 'PRETTY_NAME' in line: