group listings can deal with nomssfu entries. Added todo file

This commit is contained in:
2013-07-22 17:18:40 +02:00
parent 8898b03ad5
commit 597478879e
3 changed files with 38 additions and 6 deletions
+7 -4
View File
@@ -340,7 +340,10 @@ try:
#sys.stdout.write("\n".join(ldapdir.get_groups_for_user(user_to_group))
# + "\n")
except LdapUserDirError, err:
sys.stderr.write('Error: ' + str(err) +'\n')
if str(err) == "No such user":
sys.stderr.write('Error: No such user (%s)\n' % user_to_group)
else:
sys.stderr.write('Error: ' + str(err) +'\n')
sys.exit(1)
elif mode == 'add':
@@ -362,8 +365,8 @@ except ldap.INVALID_CREDENTIALS, e:
except ldap.LDAPError, e:
sys.stderr.write('Unhandled LDAP error: %s\n' % str(e))
sys.exit(1)
except Exception, err:
sys.stderr.write('Unhandled Exception (%s): %s\n' % (type(err), str(err)))
sys.exit(1)
# except Exception, err:
# sys.stderr.write('Unhandled Exception (%s): %s\n' % (type(err), str(err)))
# sys.exit(1)
sys.exit(0)
+10 -2
View File
@@ -486,7 +486,11 @@ class LdapUserDir(object):
print "group: %s" % dn,
else:
print "group: %s" % entry['cn'][0],
print "(%s)" % entry['msSFU30GidNumber'][0]
if not 'msSFU30GidNumber' in entry:
gid = '---'
else:
gid = entry['msSFU30GidNumber'][0]
print "(%s)" % gid
if 'member' in entry:
for cn in entry['member']:
if returndn:
@@ -495,7 +499,11 @@ class LdapUserDir(object):
print ' member: ', self.dn_to_cn(cn)
else:
for dn, entry in r:
print "%s:IGNORE:%s:" % (entry['cn'][0], entry['msSFU30GidNumber'][0]),
if not 'msSFU30GidNumber' in entry:
gid = '---'
else:
gid = entry['msSFU30GidNumber'][0]
print "%s:IGNORE:%s:" % (entry['cn'][0], gid),
if 'member' in entry:
print ",".join([self.dn_to_cn(dn) for dn in entry['member']])
+21
View File
@@ -0,0 +1,21 @@
#+TITLE: todo for ldapuserdir
#+DATE: <2013-07-22 Mon>
#+AUTHOR: Derek Feichtinger
#+EMAIL: derek.feichtinger@psi.ch
#+OPTIONS: ':nil *:t -:t ::t <:t H:3 \n:nil ^:t arch:headline
#+OPTIONS: author:t c:nil creator:comment d:(not LOGBOOK) date:t e:t
#+OPTIONS: email:nil f:t inline:t num:t p:nil pri:nil stat:t tags:t
#+OPTIONS: tasks:t tex:t timestamp:t toc:t todo:t |:t
#+CREATOR: Emacs 24.3.1 (Org mode 8.0.6)
#+DESCRIPTION:
#+EXCLUDE_TAGS: noexport
#+KEYWORDS:
#+LANGUAGE: en
#+SELECT_TAGS: export
* Bugfixes
- [ ] In the case of big groups, ldap returns the results with the attribute name
member being extended for the slice information. Need to implement the client
to be able to deal with this.
- Dani's docu may help https://intranet.psi.ch/AIT/AdLdapClientConfiguration