-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
beaker-refresh-ldap fails - user lacks email addr #243
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nits.
IntegrationTests/src/bkr/inttest/server/tools/test_refresh_ldap.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @cbouchar . This looks good to me.
I'm scared that based on those test failures that GitHub may have finally killed support for being able to run CentOS 7 😱 |
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.
158d2b7
to
f161e57
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @cbouchar
I approve 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
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.