From d0786b2697d0fad19f3387083cb0c60728872e12 Mon Sep 17 00:00:00 2001 From: Mikhail Grebenkin Date: Mon, 19 Nov 2018 21:21:18 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BC=D0=B5=D0=BB=D0=BA=D0=B8=D0=B5=20=D0=B8?= =?UTF-8?q?=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F,=20=D1=82?= =?UTF-8?q?=D0=B5=D1=81=D1=82=D0=B8=D1=80=D1=83=D1=8E.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- importer.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/importer.py b/importer.py index 1185557..4a0831f 100644 --- a/importer.py +++ b/importer.py @@ -16,6 +16,14 @@ import zayavka_reader as z_reader base = "CN=Users,DC=techgrow,DC=local" # можно не заморачиваться с ОУ и тогда base = "CN=Users,DC=myDom,DC=lan" domainName = 'techgrow.local' +dbconn = {'host': '10.1.11.26', + 'user': 'LDAP2018', + 'pass': 'Pr4t7UEZITwW1AYG', + 'base': 'sitemanager0'} + +sql = 'select * from LDAP' + +ad_groups = ['vpn-users', 'gogs'] def users_make_ad(sam, base): expression = "(&(objectCategory=person)(objectClass=user))" @@ -39,7 +47,7 @@ def main(): lp = samba.param.LoadParm() lp.load(samba.param.default_path()) # или lp.load("/etc/samba/smb.conf") sam = SamDB(lp=lp, session_info=system_session()) - z_users = z_reader.users_make_zayavka() + z_users = z_reader.users_make_zayavka(z_reader.mysql_reader(dbconn, sql), ad_groups) print len(z_users) for z_user in z_users: print z_user