From 1227d472d131ae6f262e7d23d7caee77a3b7bff9 Mon Sep 17 00:00:00 2001 From: bernat Date: Sat, 5 Mar 2005 17:46:00 +0100 Subject: [PATCH] Comprendre pourquoi il n'arrive pas se connecter darcs-hash:20050305164600-d1718-d7b2838c841feb8bcba5e7be67fe558031a3c7c7.gz --- gestion/hptools.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 """