diff --git a/gestion/tools/locate-mac.py b/gestion/tools/locate-mac.py index ce373b60..5783d520 100755 --- a/gestion/tools/locate-mac.py +++ b/gestion/tools/locate-mac.py @@ -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)