pexpect Timeout exceeded in read_nonblocking()
gg resolve from bbs:
vi /usr/lib/python2.6/site-packages/pxssh.py
#add line 134,135:
123 def synch_original_prompt (self):
124
125 “””This attempts to find the prompt. Basically, press enter and record
126 the response; press enter again and record the response; if the two
127 responses are similar then assume we are at the original prompt. “””
128
129 # All of these timing pace values are magic.
130 # I came up with these based on what seemed reliable for
131 # connecting to a heavily loaded machine I have.
132 # If latency is worse than these values then this will fail.
133
134 self.sendline()
135 time.sleep(0.5)
136 self.read_nonblocking(size=10000,timeout=1) # GAS: Clear out the cache before getting the prompt
137 time.sleep(0.1)
we just put something there before ssh expect read.
本文固定链接: https://www.2hei.net/2011/10/24/pexpect_timeout_exceeded/ | 2hei.net
最活跃的读者