From: Dan Scott Date: Mon, 5 Dec 2011 16:44:30 +0000 (-0500) Subject: LDAP: More robust processing and error reporting X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a892ed08cdca2da71e1112cdf32ae20e536f1c81;p=contrib%2FConifer.git LDAP: More robust processing and error reporting Don't die if we don't have an lulColleagueId; spit out the attributes that we have ready at hand to help identify the problem record. Signed-off-by: Dan Scott --- diff --git a/tools/patron-load/ldap_osrf_sync b/tools/patron-load/ldap_osrf_sync index eee82ddcbe..4fb5a57e2b 100755 --- a/tools/patron-load/ldap_osrf_sync +++ b/tools/patron-load/ldap_osrf_sync @@ -133,6 +133,10 @@ class User: Map LDAP record to Evergreen identity type and value """ + if 'lulColleagueId' not in self.ldap_atts: + print >> sys.stderr, 'No lulColleagueId for %s' % (self.ldap_atts) + return 2, 'NO_COLLEAGUE_ID' + ident_value = self.ldap_atts['lulColleagueId'][0].strip().lower() if len(ident_value) != 7: print >> sys.stderr, 'Datatel number not 7 chars for %s (%s)' % ( @@ -175,7 +179,7 @@ class User: return profile_map[affiliation] else: print >> sys.stderr, "Affiliation '%s' not mapped to a profile " \ - "for user %s" % (affiliation, self.usrname) + "for user %s" % (affiliation, self.ldap_atts) return None def get_home_ou(self):