From afee462b63f836b506750b23c6961162234ee0e1 Mon Sep 17 00:00:00 2001 From: Daniel STAN Date: Sat, 18 May 2013 03:39:13 +0200 Subject: [PATCH] =?UTF-8?q?On=20isole=20la=20conn=20lc=5Fldap=20readonly,?= =?UTF-8?q?=20pour=20r=C3=A9utilisation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Python/etc/ssh/ssh_known_hosts | 10 ++-------- etc/python/ldap_conn.py | 10 ++++++++++ 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 etc/python/ldap_conn.py diff --git a/Python/etc/ssh/ssh_known_hosts b/Python/etc/ssh/ssh_known_hosts index 11150cd..12f418a 100644 --- a/Python/etc/ssh/ssh_known_hosts +++ b/Python/etc/ssh/ssh_known_hosts @@ -1,18 +1,12 @@ # -*- coding: utf-8; mode: python -*- include("mode/space") +include("ldap_conn") header("Configuration du serveur ssh") -import sys -sys.path.append('/usr/scripts/') -sys.path.append('/usr/scripts/gestion') -import lc_ldap.shortcuts -import config - -conn=lc_ldap.shortcuts.lc_ldap_readonly(user="sshfingerprint") -machines=conn.search("objectClass=machineCrans") +machines=ldap_conn.search("objectClass=machineCrans") key_machines={} diff --git a/etc/python/ldap_conn.py b/etc/python/ldap_conn.py new file mode 100644 index 0000000..a9b8467 --- /dev/null +++ b/etc/python/ldap_conn.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# +# Connexion à la base ldap (pour requêtes diverses) + +import sys +sys.path.append('/usr/scripts/') +import lc_ldap.shortcuts +sys.path.pop() + +ldap_conn=lc_ldap.shortcuts.lc_ldap_readonly(user="bcfg2")