From 45f862aeda12746bf039dd239e645cb2ea70ada8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B4=E6=AF=85?= Date: Tue, 13 Aug 2024 16:56:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3gs=5Fom=20-t=20status=20--det?= =?UTF-8?q?ail=E6=89=93=E5=8D=B0=E7=9A=84=E4=B8=BB=E6=9C=BA=E5=90=8D?= =?UTF-8?q?=E8=A2=AB=E8=84=B1=E6=95=8F=E5=AF=BC=E8=87=B4=E7=94=9F=E6=88=90?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E9=9D=99=E6=80=81=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=EF=BC=8C=E5=AF=BC=E8=87=B4=E6=89=A9=E5=AE=B9?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/gspylib/threads/SshTool.py | 5 ++++- script/impl/om/OmImpl.py | 11 +++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/script/gspylib/threads/SshTool.py b/script/gspylib/threads/SshTool.py index 54ada8cd..d5f451d7 100644 --- a/script/gspylib/threads/SshTool.py +++ b/script/gspylib/threads/SshTool.py @@ -730,7 +730,10 @@ class SshTool(): hostname = hostList if status == 0: resultMap[hostname[0]] = DefaultValue.SUCCESS - outputCollect = "[%s] %s:\n%s" % ("SUCCESS", hostname[0], + if "gs_om -t status --detail" in cmd: + outputCollect = "[%s] %s:\n%s" % ("SUCCESS", hostname[0], output) + else: + outputCollect = "[%s] %s:\n%s" % ("SUCCESS", hostname[0], SensitiveMask.mask_pwd(output)) if not os.path.exists(self.__outputPath): diff --git a/script/impl/om/OmImpl.py b/script/impl/om/OmImpl.py index 7b7ef7cb..b8a9c5a5 100644 --- a/script/impl/om/OmImpl.py +++ b/script/impl/om/OmImpl.py @@ -181,12 +181,15 @@ class OmImpl: node_head = temp_lines[-3].split("|")[0] node_split = "-" * len(node_head) node_info = [info.strip() for info in temp_lines[-1].split("|")] - self.logger.log("\n".join(temp_lines[:-3] + [node_head] + [node_split] + - node_info)) + result = "\n".join(temp_lines[:-3] + [node_head] + [node_split] + node_info) + print(result) + self.logger.debug(result) else: - self.logger.log(output) + print(output) + self.logger.debug(output) if node_status_line: - self.logger.log(node_status_line) + print(node_status_line) + self.logger.debug(node_status_line) else: if node_status_line: FileUtil.createFileInSafeMode(self.context.g_opts.outFile) -- Gitee