在运行下面的脚本时,我得到了传输错误。
#!/usr/bin/python
import paramiko
print("hello world")
ssh=paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('host_IP',username='user',password='passwd')
cmd='/usr/lib/qlogic/qmgr-ui'
print(cmd)
stdin,stdout,stderr=ssh.exec_command(cmd)
z=stdout.read
print(z)
ssh.close()错误是:
<bound method ChannelFile.read of <paramiko.ChannelFile from <paramiko.Channel 0 (open) window=2097152 -> <paramiko.Transport at 0xac44ff28 (cipher aes128-ctr, 128 bits) (active; 1 open channel(s))>>>>对于另一个服务/usr/lib/qlogic/qmgr,它工作正常,但对于qmgr-ui服务,它不工作。有谁能帮帮我吗?
谢谢,尼基尔。
发布于 2016-06-24 04:44:40
问题出在"read“语句上
应该是:z=stdout.read()
https://stackoverflow.com/questions/30167109
复制相似问题