From d72c284c5c5929109a81b911dec34806332b7849 Mon Sep 17 00:00:00 2001 From: Daniel STAN Date: Thu, 21 Jun 2012 11:20:06 +0200 Subject: [PATCH] =?UTF-8?q?[hptools]=20recherche=20de=20mac=20sans=20?= =?UTF-8?q?=C3=A9chec?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ignore-this: f21caadc92a30890ad13fc0d55c0f696 mais vu le patch, je me demande si c'est pas une tentative pour planquer la poussière sous le tapis :p darcs-hash:20120621092006-28565-91890d316daaac9281903319a9479e71d71afce2.gz --- gestion/hptools.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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