-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
beaker-refresh-ldap fails - user lacks email addr
Some Beaker installations learns user via ldap groups. One user did not have an email address resulting in beaker-refresh-ldap raising an exception: KeyError: 'mail'. Offending line is here: File "/usr/lib/python2.7/site-packages/bkr/server/model/identity.py", line 301, in by_user_name user.email_address = attrs['mail'][0].decode('utf8') KeyError: 'mail' When this exception is encountered, beaker-refresh-ldap stops learning other users. Fix: When missing any required key attributes (Mail, uid, cn), the user will not be returned and as a result will not be learned without raising an exception. This allows beaker-refresh-ldap to continue learning other users.
- Loading branch information
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,6 +104,20 @@ gidNumber: 15554 | |
homeDirectory: /home/lol | ||
mail: [email protected] | ||
|
||
dn: uid=nomailattr,ou=users,dc=example,dc=invalid | ||
objectClass: top | ||
objectClass: person | ||
objectClass: organizationalperson | ||
objectClass: inetorgperson | ||
objectClass: posixAccount | ||
cn: NoMail Attribute | ||
givenName: NoMail | ||
sn: nomailattr | ||
uid: nomailattr | ||
uidNumber: 15555 | ||
gidNumber: 15555 | ||
homeDirectory: /home/nomailattr | ||
|
||
dn: cn=my_ldap_group,ou=groups,dc=example,dc=invalid | ||
objectClass: top | ||
objectClass: posixGroup | ||
|
@@ -124,6 +138,7 @@ objectClass: posixGroup | |
gidNumber: 5519 | ||
cn: alp | ||
memberUid: jgillard | ||
memberUid: nomailattr | ||
|
||
dn: cn=wyfp,ou=groups,dc=example,dc=invalid | ||
objectClass: top | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters