!869 修复 gs_ssh 执行 bash 内建命令失败 [YC]

Merge pull request !869 from 邮储-王建达/bugfix_gs_ssh执行bash内建命令失败
This commit is contained in:
opengauss_bot 2024-09-12 07:53:42 +00:00 committed by Gitee
commit 21eed651ae
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -149,25 +149,7 @@ General options:
cmdFile = "%s/ClusterCall_%d.sh"\
% (EnvUtil.getTmpDirFromEnv(), os.getpid())
try:
# Queries the existence of objects that
# the command executes in all nodes
command = (self.cmd.strip()).split(" ")
checkCmd = g_file.SHELL_CMD_DICT["getFullPathForShellCmd"] % \
command[0]
(status, output) = self.sshTool.getSshStatusOutput(checkCmd)
# Resolve all node execution results
for node in status.keys():
if (status[node] != DefaultValue.SUCCESS):
failedNodes += "%s " % node
else:
succeedNodes += "%s " % node
if (failedNodes != ""):
GaussLog.exitWithError(ErrorCode.GAUSS_524["GAUSS_52403"]
% (command[0], failedNodes))
failedNodes = ""
succeedNodes = ""
executeCmd = self.cmd
#############################################################
FileUtil.createFile(cmdFile, True, DefaultValue.FILE_MODE)