Mise en forme correcte de l'adresse mac
darcs-hash:20041112185335-72cb0-2456059855950cf3be218faa13bdad45e9badf07.gz
This commit is contained in:
parent
06acbab00d
commit
a7bc696514
1 changed files with 3 additions and 1 deletions
|
@ -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:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue