From c17154d1d4f2dee6905f6e18dfcd7fc4b865fd42 Mon Sep 17 00:00:00 2001 From: lihaipeng Date: Mon, 19 Aug 2024 05:06:36 -0400 Subject: [PATCH 01/13] Example Modify the primary directory of the server service --- index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.py b/index.py index 2a74e8a..42bbf7d 100644 --- a/index.py +++ b/index.py @@ -16,7 +16,7 @@ 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'/*') -- Gitee From 518d8a35633efea874e54ae758fabb89e3ada57f Mon Sep 17 00:00:00 2001 From: lihaipeng Date: Mon, 19 Aug 2024 22:26:38 -0400 Subject: [PATCH 02/13] Example Modify the home directory on the server --- index.py | 2 +- migration-tools.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.py b/index.py index 42bbf7d..071ea71 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 diff --git a/migration-tools.spec b/migration-tools.spec index 6e192de..133373b 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 -- Gitee From 9dcaeffe1e620deb8e1aefa25f1a48d1da94e5d7 Mon Sep 17 00:00:00 2001 From: lihaipeng Date: Mon, 19 Aug 2024 22:35:21 -0400 Subject: [PATCH 03/13] Add file existence judgment --- uos-sysmig/mig_merge/stock_replace/confirm.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/uos-sysmig/mig_merge/stock_replace/confirm.py b/uos-sysmig/mig_merge/stock_replace/confirm.py index 5009f38..34ac9ff 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: -- Gitee From 6044af1d2c4357f6fe8b14707a918e273b4e1716 Mon Sep 17 00:00:00 2001 From: lihaipeng Date: Mon, 19 Aug 2024 22:38:23 -0400 Subject: [PATCH 04/13] Add file existence judgment --- uos-sysmig/mig_merge/stock_replace/confirm.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/uos-sysmig/mig_merge/stock_replace/confirm.py b/uos-sysmig/mig_merge/stock_replace/confirm.py index 5009f38..34ac9ff 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: -- Gitee From 63437bb89fa83190d87bbd4ba76bf6e47ea754c4 Mon Sep 17 00:00:00 2001 From: lihaipeng Date: Mon, 19 Aug 2024 22:49:41 -0400 Subject: [PATCH 05/13] Revert "Add file existence judgment" This reverts commit 9dcaeffe1e620deb8e1aefa25f1a48d1da94e5d7. --- uos-sysmig/mig_merge/stock_replace/confirm.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/uos-sysmig/mig_merge/stock_replace/confirm.py b/uos-sysmig/mig_merge/stock_replace/confirm.py index 34ac9ff..5009f38 100644 --- a/uos-sysmig/mig_merge/stock_replace/confirm.py +++ b/uos-sysmig/mig_merge/stock_replace/confirm.py @@ -58,11 +58,6 @@ 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: -- Gitee From 1f491933cce109ac7966e5b6f25a359ba8e5d729 Mon Sep 17 00:00:00 2001 From: lihaipeng Date: Mon, 19 Aug 2024 22:50:18 -0400 Subject: [PATCH 06/13] Revert "Example Modify the home directory on the server" This reverts commit 518d8a35633efea874e54ae758fabb89e3ada57f. --- index.py | 2 +- migration-tools.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.py b/index.py index 071ea71..42bbf7d 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/migration-tools-server') +os.chdir('/usr/lib/uos-sysmig-server') from connect_sql import * from logger import * from sysmig_agent.share import getSysMigConf diff --git a/migration-tools.spec b/migration-tools.spec index 133373b..6e192de 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.conf $RPM_BUILD_ROOT/etc/migration-tools +%{__cp} -r $RPM_BUILD_ROOT/usr/lib/migration-tools-server/server/migration-tools-server.service $RPM_BUILD_ROOT/etc/migration-tools %post -n migration-tools-server -- Gitee From ae1aa7ad3a68a5c5ae4dfb6f539a3b0e720a5fe0 Mon Sep 17 00:00:00 2001 From: LiHaiPeng <8775059+nperl-li@user.noreply.gitee.com> Date: Tue, 20 Aug 2024 02:51:28 +0000 Subject: [PATCH 07/13] Revert "Add file existence judgment" This reverts commit 9dcaeffe1e620deb8e1aefa25f1a48d1da94e5d7. --- uos-sysmig/mig_merge/stock_replace/confirm.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/uos-sysmig/mig_merge/stock_replace/confirm.py b/uos-sysmig/mig_merge/stock_replace/confirm.py index 34ac9ff..5009f38 100644 --- a/uos-sysmig/mig_merge/stock_replace/confirm.py +++ b/uos-sysmig/mig_merge/stock_replace/confirm.py @@ -58,11 +58,6 @@ 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: -- Gitee From 8a9d345a7acd003c20049bb73519b8f648fdb1e7 Mon Sep 17 00:00:00 2001 From: LiHaiPeng <8775059+nperl-li@user.noreply.gitee.com> Date: Tue, 20 Aug 2024 02:51:57 +0000 Subject: [PATCH 08/13] Revert "Example Modify the home directory on the server" This reverts commit 518d8a35633efea874e54ae758fabb89e3ada57f. --- index.py | 2 +- migration-tools.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.py b/index.py index 071ea71..42bbf7d 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/migration-tools-server') +os.chdir('/usr/lib/uos-sysmig-server') from connect_sql import * from logger import * from sysmig_agent.share import getSysMigConf diff --git a/migration-tools.spec b/migration-tools.spec index 133373b..6e192de 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.conf $RPM_BUILD_ROOT/etc/migration-tools +%{__cp} -r $RPM_BUILD_ROOT/usr/lib/migration-tools-server/server/migration-tools-server.service $RPM_BUILD_ROOT/etc/migration-tools %post -n migration-tools-server -- Gitee From 63fd04f7e58d0154cb8acfa8e919247d9de016f1 Mon Sep 17 00:00:00 2001 From: LiHaiPeng <8775059+nperl-li@user.noreply.gitee.com> Date: Tue, 20 Aug 2024 02:52:17 +0000 Subject: [PATCH 09/13] Revert "Example Modify the primary directory of the server service" This reverts commit c17154d1d4f2dee6905f6e18dfcd7fc4b865fd42. --- index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.py b/index.py index 42bbf7d..2a74e8a 100644 --- a/index.py +++ b/index.py @@ -16,7 +16,7 @@ from flask_cors import CORS # import MySQLdb -os.chdir('/usr/lib/migration-tools-server') +os.chdir('/usr/lib/uos-sysmig-server') app = Flask(__name__) migration_log = Logger('/var/tmp/uos-migration/migration.log', logging.DEBUG, logging.DEBUG) CORS(app, resources=r'/*') -- Gitee From 0ad6b1bc2d57a655d68caa451a8aa9c6b1b52901 Mon Sep 17 00:00:00 2001 From: lihaipeng Date: Mon, 19 Aug 2024 22:53:44 -0400 Subject: [PATCH 10/13] Example Modify the primary directory of the server service --- index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.py b/index.py index 2a74e8a..071ea71 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 @@ -16,7 +16,7 @@ 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'/*') -- Gitee From c727bede18bc054e77236ff39f60531e06c3f828 Mon Sep 17 00:00:00 2001 From: lihaipeng Date: Mon, 19 Aug 2024 23:12:48 -0400 Subject: [PATCH 11/13] Delete redundant empty lines --- index.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/index.py b/index.py index 071ea71..8c4da04 100644 --- a/index.py +++ b/index.py @@ -14,14 +14,12 @@ from views.migration import * from views.server import * from flask_cors import CORS - # import MySQLdb 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() -- Gitee From 7571a7889d81bc9ebde2088ca9573e991fda920e Mon Sep 17 00:00:00 2001 From: lihaipeng Date: Mon, 19 Aug 2024 23:26:22 -0400 Subject: [PATCH 12/13] Update the configuration file on the server --- migration-tools.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration-tools.spec b/migration-tools.spec index 6e192de..133373b 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 -- Gitee From 27dcde53a46cd45c37d5acef7cef1c4b68ff5736 Mon Sep 17 00:00:00 2001 From: lihaipeng Date: Mon, 19 Aug 2024 23:30:08 -0400 Subject: [PATCH 13/13] Added the system product profile existence check --- uos-sysmig/mig_merge/stock_replace/confirm.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/uos-sysmig/mig_merge/stock_replace/confirm.py b/uos-sysmig/mig_merge/stock_replace/confirm.py index 5009f38..34ac9ff 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: -- Gitee