From 3c246bdd1a5b4d21d203f30247be7b68fe630942 Mon Sep 17 00:00:00 2001 From: z00793368 Date: Tue, 26 Sep 2023 19:30:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0A5=E6=A3=80=E6=9F=A5=E9=A1=B9?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/gspylib/common/ErrorCode.py | 3 ++- script/impl/preinstall/PreinstallImpl.py | 2 -- script/impl/uninstall/UninstallImpl.py | 2 -- script/local/LocalCheckOS.py | 7 +++++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/script/gspylib/common/ErrorCode.py b/script/gspylib/common/ErrorCode.py index 82de327..a4e4cc9 100644 --- a/script/gspylib/common/ErrorCode.py +++ b/script/gspylib/common/ErrorCode.py @@ -288,7 +288,8 @@ class ErrorCode(): "the actual memory.", 'GAUSS_50501': "[GAUSS-50501] : Shared_buffers must be less than " "shmmax. Please check it.", - 'GAUSS_50502': "[GAUSS-50502] : Failed to obtain %s information." + 'GAUSS_50502': "[GAUSS-50502] : Failed to obtain %s information.", + 'GAUSS_50503': "[GAUSS-50503] : %s, program exists abnormally." } ########################################################################### diff --git a/script/impl/preinstall/PreinstallImpl.py b/script/impl/preinstall/PreinstallImpl.py index 237af3c..e1f0f62 100644 --- a/script/impl/preinstall/PreinstallImpl.py +++ b/script/impl/preinstall/PreinstallImpl.py @@ -1359,8 +1359,6 @@ class PreinstallImpl: if found_enabledss: with open(source_file, "w") as file: file.writelines(file_lines) - else: - return def checkRepeat(self): """ diff --git a/script/impl/uninstall/UninstallImpl.py b/script/impl/uninstall/UninstallImpl.py index 78bbf7b..da6aeb1 100644 --- a/script/impl/uninstall/UninstallImpl.py +++ b/script/impl/uninstall/UninstallImpl.py @@ -455,8 +455,6 @@ class UninstallImpl: if self.mpprcFile and os.path.isfile(self.mpprcFile): source_file = self.mpprcFile - else: - source_file = os.path.join("/etc", "profile") if is_dsshome and not is_enabledssset: with open(source_file, 'a') as file: diff --git a/script/local/LocalCheckOS.py b/script/local/LocalCheckOS.py index 7fcc3e3..658d1d7 100644 --- a/script/local/LocalCheckOS.py +++ b/script/local/LocalCheckOS.py @@ -1995,8 +1995,11 @@ def CheckMemInfo(): input : NA output : NA """ - memdata = collectMemInfo() - swapdata = collectSwapInfo() + try: + memdata = collectMemInfo() + swapdata = collectSwapInfo() + except SystemExit as e: + raise Exception(ErrorCode.GAUSS_505["GAUSS_50503"] % e) if (swapdata.swapvalue > memdata.memvalue): g_logger.log("SwapMemory %s TotalMemory %s" % (swapdata.swapvalue, memdata.memvalue))