From e3e9e79965a669ef0aeb9b8fc23d191d5e97492c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Barnouin?= Date: Thu, 4 Jan 2024 15:58:52 +0100 Subject: [PATCH] Esthetic fixes --- ldap2smb.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ldap2smb.py b/ldap2smb.py index 49c60c3..9090de4 100644 --- a/ldap2smb.py +++ b/ldap2smb.py @@ -18,7 +18,6 @@ creds.set_password('Jps55Sk8An9y2nVL') samdb = SamDB(url='/var/lib/samba/private/sam.ldb', session_info=system_session(),credentials=creds, lp=lp) data_file="user.json" -attributes_list = [] with open(data_file, "r") as file: ldap_users = json.load(file) @@ -36,7 +35,17 @@ with open(data_file, "r") as file: smb_uid_number = ldap_users["params"]["attributes"]["uidNumber"] smb_gid_number = ldap_users["params"]["attributes"]["gidNumber"] - samdb.newuser(username=smb_username,password=smb_passwd,givenname=smb_givenname,surname=smb_surname,homedirectory=smb_homedir,mailaddress=smb_mail,uidnumber=smb_uid_number,gidnumber=smb_gid_number,useusernameascn=True) + samdb.newuser( + username=smb_username, + password=smb_passwd, + givenname=smb_givenname, + surname=smb_surname, + homedirectory=smb_homedir, + mailaddress=smb_mail, + uidnumber=smb_uid_number, + gidnumber=smb_gid_number, + useusernameascn=True + ) query = "(objectclass=user)" result = samdb.search('DC=nantes,DC=omero-fbi,DC=fr', expression=query, scope=ldb.SCOPE_SUBTREE)