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
|
from os import system
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
sys.path.append('/usr/scripts/gestion')
|
if '/usr/scripts' not in sys.path:
|
||||||
from ldap_crans import crans_ldap
|
sys.path.append('/usr/scripts')
|
||||||
import whos
|
from gestion.ldap_crans import crans_ldap
|
||||||
from annuaires_pg import all_switchs
|
from gestion import whos
|
||||||
from hptools import hpswitch
|
from gestion.annuaires_pg import all_switchs
|
||||||
|
from gestion.hptools import hpswitch
|
||||||
|
|
||||||
# mise en forme d'une adresse mac
|
# mise en forme d'une adresse mac
|
||||||
def format_mac(unformated_mac):
|
def format_mac(unformated_mac):
|
||||||
|
@ -59,8 +60,8 @@ def info_machine(mac):
|
||||||
# interrogation des switchs en parallele
|
# interrogation des switchs en parallele
|
||||||
def trace_machine(mac, affiche_uplinks=False):
|
def trace_machine(mac, affiche_uplinks=False):
|
||||||
tableau = []
|
tableau = []
|
||||||
|
# ce code ne fork plus rien du tout depuis e05c4be14c86da88413c598e4c
|
||||||
for switch in ['backbone.adm.crans.org'] + all_switchs() + ['multiprise-v6']:
|
for switch in all_switchs(hide=[]):
|
||||||
tableau.append(interroge_switch(switch, mac, affiche_uplinks))
|
tableau.append(interroge_switch(switch, mac, affiche_uplinks))
|
||||||
|
|
||||||
for t in tableau:
|
for t in tableau:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue