[arpwatch] bugfix: pas de connexion ldap implicite
Uniquement si on a réellement un objet à whoser et cie. En l'occurence, l'import du module de traçage importe également ldap_crans …
This commit is contained in:
parent
90ff8f1913
commit
093fa67e0b
1 changed files with 4 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/bin/bash /usr/scripts/python.sh
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Ajout d'un whos et d'un tracage aux mails d'arpwatch
|
||||
|
@ -12,8 +12,7 @@ import socket
|
|||
|
||||
import common
|
||||
|
||||
sys.path.append('/usr/scripts')
|
||||
from gestion.tools.locate_mac import trace_machine, format_mac, info_machine
|
||||
# Keep away from here les modules qui font des connexions ldap sans le dire (!)
|
||||
from gestion.config import NETs
|
||||
from gestion.iptools import AddrInNets
|
||||
from utils.sendmail import sendmail
|
||||
|
@ -30,6 +29,8 @@ arpwatched_net = NETs['all'] + NETs['adm'] + NETs['accueil'] + NETs['isolement']
|
|||
|
||||
def get_machine(unformated_mac):
|
||||
"""Renvoie les informations sur la machine à partir de sa mac"""
|
||||
# Ceci est importé ici car cela génère une connexion ldap (sic)
|
||||
from gestion.tools.locate_mac import trace_machine, format_mac, info_machine
|
||||
mac = format_mac(unformated_mac)
|
||||
return u"\n" + info_machine(mac) + u"\n" + trace_machine(mac)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue