Comprendre pourquoi il n'arrive pas se connecter
darcs-hash:20050305164600-d1718-d7b2838c841feb8bcba5e7be67fe558031a3c7c7.gz
This commit is contained in:
parent
5ac75ce6f0
commit
1227d472d1
1 changed files with 8 additions and 1 deletions
|
@ -51,7 +51,14 @@ class ssh :
|
|||
self.ssh = pexpect.spawn("ssh %s" % host)
|
||||
self.ssh.sendline("")
|
||||
self.ssh.sendline("configure")
|
||||
self.ssh.expect("%s\(config\)# " % self.switch, timeout=10)
|
||||
try:
|
||||
self.ssh.expect("%s\(config\)# " % self.switch, timeout=20)
|
||||
except pexpect.TIMEOUT:
|
||||
print "Timeout !"
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
print "Contenu du buffer :"
|
||||
print self.ssh.before
|
||||
|
||||
def __del__(self) :
|
||||
"""Ferme la connexion : envoi logout et attend """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue