diff --git a/gestion/hptools.py b/gestion/hptools.py index a221c9db..9e647e4b 100755 --- a/gestion/hptools.py +++ b/gestion/hptools.py @@ -129,6 +129,7 @@ class snmp : def __exec(self,cmd) : s, r = getstatusoutput(cmd) if s : + r=r.replace('snmpget: ','') raise ConversationError(r,self.host) return r diff --git a/gestion/whos.py b/gestion/whos.py index aea506a9..972eb5f1 100755 --- a/gestion/whos.py +++ b/gestion/whos.py @@ -327,6 +327,8 @@ def adher_details(adher) : f += addr[0] + u'\n' if addr[1] != ' ' : f += u' ' + addr[1] + u'\n' f+= u' ' + addr[2] + u' ' + addr[3] + '\n' + elif chbre == '????' : + f += coul(u'Chambre invalide\n','violet') else : # Chambre + prise (d'après annuaire) f += coul(u'Chambre : ','gras') + u"%s " % chbre @@ -553,7 +555,7 @@ def club_details(club) : # Chambre + prise f += coul(u'Local : ','gras') + "%s " % club.local() - f += u'(%s)' % prise_etat(club.chbre()) + f += u'(%s)' % prise_etat(club.chbre()) f += u'\n' # Paiement @@ -748,11 +750,18 @@ def prise_etat(chbre) : f+= u', ' + coul(u'prise désactivée','rouge') else : f+= u', activée, lien non détecté' - except ConversationError: + except ConversationError, r: # Switch non manageable ou down - f += u', erreur de communication avec le switch' + f += ', ' + f+= {'Unknown host (No such file or directory)' : + u'switch non manageable', + 'Failure in sendto (Operation not permitted)' : + u'infos prise non dispo : filtre vers adm par fw', + 'sh: line 1: command not found' : + u'infos prise non dispo depuis cette machine' + }.get(r.args[0],r.args[0]) except : - f = u'info prise non dispo : erreur prog' + f = u'infos prise non dispo : erreur interne' return f