diff --git a/gestion/hptools.py b/gestion/hptools.py index 2a787fd5..6c26477a 100644 --- a/gestion/hptools.py +++ b/gestion/hptools.py @@ -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 """