On laisse la possibilit d'afficher les uplinks.

darcs-hash:20070315001009-68412-afa912714249815f249fbdaa06938ddcdd5e848c.gz
This commit is contained in:
glondu 2007-03-15 01:10:09 +01:00
parent c41b588bc6
commit 2d79255543

View file

@ -35,7 +35,7 @@ class interroge_switch (threading.Thread) :
iteration = iteration-1
if (prise != None):
nom=sw.nom(None,prise)
if nom.find("uplink")==-1:
if affiche_uplinks or "uplink" not in nom:
self.reponse = ("%-10s => prise %-2s : %s" % (self.switch.encode('iso-8859-15').replace('.adm.crans.org',''), str(prise), nom))
@ -80,5 +80,6 @@ def trace_machine(mac):
# on interroge les switchs et on fait un whos sur la mac
if __name__ == '__main__':
mac = format_mac(sys.argv[1])
affiche_uplinks = len(sys.argv) > 2 and bool(sys.argv[2])
print trace_machine(mac)
print system('/usr/scripts/gestion/whos.py -a mac=%s' % mac)