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")