diff --git a/gestion/tools/locate_mac.py b/gestion/tools/locate_mac.py index 2b37cffa..b2d881a5 100755 --- a/gestion/tools/locate_mac.py +++ b/gestion/tools/locate_mac.py @@ -6,11 +6,12 @@ from time import sleep from os import system import threading -sys.path.append('/usr/scripts/gestion') -from ldap_crans import crans_ldap -import whos -from annuaires_pg import all_switchs -from hptools import hpswitch +if '/usr/scripts' not in sys.path: + sys.path.append('/usr/scripts') +from gestion.ldap_crans import crans_ldap +from gestion import whos +from gestion.annuaires_pg import all_switchs +from gestion.hptools import hpswitch # mise en forme d'une adresse mac def format_mac(unformated_mac): @@ -59,8 +60,8 @@ def info_machine(mac): # interrogation des switchs en parallele def trace_machine(mac, affiche_uplinks=False): tableau = [] - - for switch in ['backbone.adm.crans.org'] + all_switchs() + ['multiprise-v6']: + # ce code ne fork plus rien du tout depuis e05c4be14c86da88413c598e4c + for switch in all_switchs(hide=[]): tableau.append(interroge_switch(switch, mac, affiche_uplinks)) for t in tableau: