Skip NO_COLLEAGUE_ID situation
authorDan Scott <dscott@laurentian.ca>
Thu, 27 Oct 2016 15:16:40 +0000 (11:16 -0400)
committerDan Scott <dscott@laurentian.ca>
Thu, 27 Oct 2016 15:46:14 +0000 (11:46 -0400)
Rather than literally using "NO_COLLEAGUE_ID" as the colleague ID, refuse to
create or update the corresponding record. Any LDAP records created through the
normal process should have colleague IDs, even for visitors/guests.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
tools/patron-load/ldap_osrf_sync

index 188899d..7deb46c 100755 (executable)
@@ -340,6 +340,9 @@ def find_ldap_users(con, ldap_filter, attributes, auth):
             if ARGS.dump_ldap:
                 dump_data(raw_atts)
                 print("dn = '%s'" % (raw_user))
+            if user.ident_value == 'NO_COLLEAGUE_ID':
+                print >> sys.stderr, "No colleague ID: skipping"
+                continue
             if ARGS.create_users:
                 res = create_evergreen_user(auth, user)
                 if res: