locate_mac: loop sur *tous* les switchs
En utilisant le paramètre idoine de all_switchs, plutôt que d'inférer et d'avoir des problèmes de dns.
This commit is contained in:
parent
22e7e40c2c
commit
d017ddb44e
1 changed files with 8 additions and 7 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue