On isole la conn lc_ldap readonly, pour réutilisation
This commit is contained in:
parent
069837f9cf
commit
afee462b63
2 changed files with 12 additions and 8 deletions
|
@ -1,18 +1,12 @@
|
||||||
# -*- coding: utf-8; mode: python -*-
|
# -*- coding: utf-8; mode: python -*-
|
||||||
|
|
||||||
include("mode/space")
|
include("mode/space")
|
||||||
|
include("ldap_conn")
|
||||||
|
|
||||||
header("Configuration du serveur ssh")
|
header("Configuration du serveur ssh")
|
||||||
|
|
||||||
|
|
||||||
import sys
|
machines=ldap_conn.search("objectClass=machineCrans")
|
||||||
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")
|
|
||||||
|
|
||||||
|
|
||||||
key_machines={}
|
key_machines={}
|
||||||
|
|
10
etc/python/ldap_conn.py
Normal file
10
etc/python/ldap_conn.py
Normal file
|
@ -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")
|
Loading…
Add table
Add a link
Reference in a new issue