Recherche possible sur prise meme si pas dans l'annuaire.

Indique le numero de prise meme sur les machines sans snmp.

darcs-hash:20051007145024-41617-edca216ef609d0f26502645179a1bb4e726e1f7b.gz
This commit is contained in:
pauget 2005-10-07 16:50:24 +02:00
parent 7ae4b258ab
commit 991c627d35

View file

@ -750,7 +750,7 @@ def prise_etat(chbre) :
f+= u', activée, lien non détecté'
except ConversationError:
# Switch non manageable ou down
f = u'info prise non dispo : erreur de communication'
f += u', erreur de communication avec le switch'
except :
f = u'info prise non dispo : erreur prog'
@ -875,25 +875,26 @@ def __recherche() :
if arg.count('=') == 1 and arg.split('=')[0] == 'prise' :
prise = arg.split('=')[1]
# Récupération de la chambre
try :
try:
from annuaires import reverse
chbre = reverse(prise[0].lower())[prise[1:]]
except :
try :
except KeyError:
try:
chbre = reverse(prise[0].lower())[prise[1:]+'-']
except :
print u"Prise inconnue."
except KeyError:
chbre=None
if chbre:
if len(chbre) != 1 :
print u"Prise correspondante à plusieurs chambres %s " % ' '.join(chbre)
return
if len(chbre) != 1 :
print u"Prise correspondante à plusieurs prises %s " % ' '.join(chbre)
return
# On fait la recherche sur la prise
chbre= prise[0] + chbre[0]
#print u"Recherche sur chambre %s" % chbre
arg = 'chbre=%s' % chbre
try :
# On fait la recherche sur la chambre
chbre= prise[0] + chbre[0]
#print u"Recherche sur chambre %s" % chbre
arg = 'chbre=%s' % chbre
# sinon on ne fait rien et on recherche sur le champ prise
try:
if only_crans :
res = { 'machine' : crans().machines() , 'adherent' : [] , 'club' : [] }
else :