我在用
ssh.exeCommand("cd /root/newbuild/" + arg_obj["nbu_path"] + " && ./install < /tmp/NBU_10.3_response_master2")
当我在 Linux 终端上运行相同的命令时,触发一个文件进行安装,它工作正常
但是当我从我的詹金斯运行同样的事情时,python代码会触发相同的命令并完成任务,但代码不会获取任何退出代码,或者可能不会退出后端的运行,它会抛出以下错误
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/paramiko/channel.py", line 697, in recv
out = self.in_buffer.read(nbytes, self.timeout)
File "/usr/local/lib/python3.9/site-packages/paramiko/buffered_pipe.py", line 154, in read
raise PipeTimeout()
paramiko.buffered_pipe.PipeTimeout
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/NBUAutomation/nbu_qualification/stages/nbu_infoscale_proliferation/test_suits/NBU_main_instllation.py", line 18, in <module>
install_netbackup(cluster,version,add_node)
File "/root/NBUAutomation/nbu_qualification/stages/nbu_infoscale_proliferation/test_suits/netbackup.py", line 187, in install_netbackup
master_2_installation(args)
File "/root/NBUAutomation/nbu_qualification/stages/nbu_infoscale_proliferation/test_suits/nbu_install.py", line 510, in master_2_installation
m2_check = ssh_m2.exeCommand("cd /root/newbuild/" + arg_obj["nbu_path"] + " && ./install < /tmp/NBU_10.3_response_master2 && exit")
File "/root/NBUAutomation/nbu_qualification/stages/nbu_infoscale_proliferation/lib/misc/ssh_module.py", line 47, in exeCommand
'stdout' : stdout.read().decode().strip(),
File "/usr/local/lib/python3.9/site-packages/paramiko/file.py", line 184, in read
new_data = self._read(self._DEFAULT_BUFSIZE)
File "/usr/local/lib/python3.9/site-packages/paramiko/channel.py", line 1359, in _read
return self.channel.recv(size)
File "/usr/local/lib/python3.9/site-packages/paramiko/channel.py", line 699, in recv
raise socket.timeout()
socket.timeout
我尝试使用额外的参数&& exit 在任务完成后退出运行,但我的安装仍然完成,但无法退出后端的代码,也没有帮助。