Explicitation des erreurs qui font que les infos prises ne sont pas dispo.
darcs-hash:20051021145911-41617-fdfaf765c53ce7523014d2187ccd9dbf8035b54b.gz
This commit is contained in:
parent
a2536fcab6
commit
56d4f315e6
2 changed files with 14 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue