!926 fix pssh bug

Merge pull request !926 from liuheng/fix35
This commit is contained in:
opengauss_bot 2024-09-23 08:50:54 +00:00 committed by Gitee
commit 63d0d0833e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 11 additions and 4 deletions

View File

@ -86,6 +86,10 @@ def test_sync_standby_name():
assert expect_output == check_sync_standby_str(dnlist, output)
# ANY grouping
output = "ANY 1 (dn_6002), ANY 1 (dn_6003)"
expect_output = "ANY 1 (dn_6002)"
assert expect_output.replace(" ", "") == check_sync_standby_str(dnlist, output).replace(" ", "")
output = "ANY 1 (dn_6002, dn_6003)"
expect_output = "ANY 1 (dn_6002)"
assert expect_output.replace(" ", "") == check_sync_standby_str(dnlist, output).replace(" ", "")

View File

@ -347,6 +347,8 @@ class PreinstallImplOLAP(PreinstallImpl):
"""
if "HOST_IP" in os.environ.keys():
return
if not self.context.current_user_root:
return
self.context.logger.log("Setting pssh path", "addStep")
try:
pssh_path = os.path.join(os.path.dirname(__file__),
@ -356,8 +358,7 @@ class PreinstallImplOLAP(PreinstallImpl):
psshlib_path = os.path.join(
os.path.dirname(__file__),
"../../../gspylib/pssh/bin/TaskPool.py")
# 将pssh放到om tools的bin目录下
dest_path = os.path.join(self.context.clusterToolPath, "script")
dest_path = "/usr/bin/"
secbox_path = "/var/chroot/usr/bin/"
cmd = "cp %s %s %s %s" % (
pssh_path, pscp_path, psshlib_path, dest_path)

View File

@ -655,7 +655,9 @@ Common options:
if not self.mpprcFile:
self.mpprcFile = ProfileFile.get_user_bashrc(self.user)
retry = 1
cmd = "source %s;pssh -s -H %s hostname" % (self.mpprcFile, node_name)
node = self.clusterInfo.getDbNodeByName(node_name)
node_ip = node.sshIps[0]
cmd = "source %s;pssh -s -H %s hostname" % (self.mpprcFile, node_ip)
while True:
(status, output) = subprocess.getstatusoutput(cmd)
self.logger.debug("Checking hostname mapping for node [%s]. output: %s" % (node_name, output))
@ -668,7 +670,7 @@ Common options:
retry += 1
time.sleep(1)
hostname_cmd = "source %s;pssh -s -H %s 'cat /etc/hostname'" % (self.mpprcFile, node_name)
hostname_cmd = "source %s;pssh -s -H %s 'cat /etc/hostname'" % (self.mpprcFile, node_ip)
(status, output) = subprocess.getstatusoutput(hostname_cmd)
if status == 0 and output.strip() == node_name:
pass