Mise en forme correcte de l'adresse mac

darcs-hash:20041112185335-72cb0-2456059855950cf3be218faa13bdad45e9badf07.gz
This commit is contained in:
salles 2004-11-12 19:53:35 +01:00
parent 06acbab00d
commit a7bc696514

View file

@ -6,9 +6,11 @@ from annuaires import reverse, all_switchs
from hptools import hpswitch from hptools import hpswitch
from sys import argv from sys import argv
mac = ":".join([i.zfill(2) for i in argv[1].split(":")]).lower()
for switch in ['backbone'] + all_switchs(): for switch in ['backbone'] + all_switchs():
sw = hpswitch(switch) sw = hpswitch(switch)
prise = sw.where_is_mac(argv[1]) prise = sw.where_is_mac(mac)
if prise != None: if prise != None:
print "%-10s: %d (%s)" % (switch, prise, sw.nom(None, prise)) print "%-10s: %d (%s)" % (switch, prise, sw.nom(None, prise))
else: else: