!961 fix 查询ssh-agent进程,控制台输出不全,导致建立互信失败

Merge pull request !961 from liuheng/fix45
This commit is contained in:
opengauss_bot 2024-11-07 09:05:45 +00:00 committed by Gitee
commit 2d4a4e1090
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -2577,7 +2577,7 @@ class DefaultValue():
return local_ips
@staticmethod
def get_pid(desc):
def get_pid(desc, width=300):
"""
function : get the ID of the process
that contains the specified content
@ -2585,7 +2585,7 @@ class DefaultValue():
output : list
"""
pids = []
cmd = "ps ux | grep '%s' | grep -v grep" % desc
cmd = "ps ux --width=%s | grep '%s' | grep -v grep" % (width, desc)
proc = FastPopen(cmd, stdout=PIPE, stderr=PIPE)
stdout, stderr = proc.communicate()
if stderr: