diff --git a/gestion/hptools.py b/gestion/hptools.py index b050a5a2..0e92b375 100644 --- a/gestion/hptools.py +++ b/gestion/hptools.py @@ -256,11 +256,14 @@ class hpswitch : # On cherche dans data la bonne adresse MAC for (onesnmp, onemac) in data.iteritems(): - onemac = findall('".*"', onemac)[0][1:-1] - if ' ' not in onemac: - onemac = " ".join("%02x" % ord(digit) for digit in mac) - if onemac.startswith(mac): - return int(onesnmp.split(".")[1]) + try: + onemac = findall('".*"', onemac)[0][1:-1] + if ' ' not in onemac: + onemac = " ".join("%02x" % ord(digit) for digit in mac) + if onemac.startswith(mac): + return int(onesnmp.split(".")[1]) + except: + pass # On a rien trouvé return None