From 2d7925554342d1be9004af9e52b9b0314e8beb1f Mon Sep 17 00:00:00 2001 From: glondu Date: Thu, 15 Mar 2007 01:10:09 +0100 Subject: [PATCH] On laisse la possibilit d'afficher les uplinks. darcs-hash:20070315001009-68412-afa912714249815f249fbdaa06938ddcdd5e848c.gz --- gestion/tools/locate-mac.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)