From 093fa67e0bbfcd62e2d972d074544e7e4009aa51 Mon Sep 17 00:00:00 2001 From: Daniel STAN Date: Fri, 8 Nov 2013 01:29:55 +0100 Subject: [PATCH] [arpwatch] bugfix: pas de connexion ldap implicite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 … --- surveillance/arpwatch/report.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/surveillance/arpwatch/report.py b/surveillance/arpwatch/report.py index 06451e07..55042bd0 100755 --- a/surveillance/arpwatch/report.py +++ b/surveillance/arpwatch/report.py @@ -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)