From 5fc7573c7b56e11f6ff85e156c6737a0991969fa Mon Sep 17 00:00:00 2001 From: pauget Date: Sun, 2 Oct 2005 15:25:27 +0200 Subject: [PATCH] Pas de caractres bizarres dans les macs lors de l'interrogation des switchs. darcs-hash:20051002132527-41617-34797465776fce26ecc16ef555f9ac2546dc06d8.gz --- gestion/hptools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gestion/hptools.py b/gestion/hptools.py index 12e4437b..ac804ab6 100755 --- a/gestion/hptools.py +++ b/gestion/hptools.py @@ -16,6 +16,7 @@ from commands import getstatusoutput from annuaires import chbre_prises, all_switchs from os.path import exists from os import system +from sre import findall try: from secrets import config_snmp_secrete @@ -190,7 +191,7 @@ class hpswitch : if self.__debug : self.__logDest.write("HP DEBUG : show_prise_mac(prise=%s)\n" % prise) try: data = self.walk('STATISTICS-MIB::hpSwitchPortFdbAddress.%d' % int(prise)) - return map(lambda x:":".join(x[1:-2].lower().split(" ")),data.values()) + return map(lambda x:findall('".*"',":".join(x.lower().split(' ')))[0][1:-1],data.values()) except ValueError: # Pas de MAC trouvée return []