Merge lp:~rlane/nova/lp707055 into lp:~hudson-openstack/nova/trunk

Proposed by Ryan Lane
Status: Merged
Approved by: Devin Carlen
Approved revision: 399
Merged at revision: 611
Proposed branch: lp:~rlane/nova/lp707055
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 18 lines (+4/-3)
1 file modified
nova/auth/ldapdriver.py (+4/-3)
To merge this branch: bzr merge lp:~rlane/nova/lp707055
Reviewer Review Type Date Requested Status
Thierry Carrez (community) Approve
Rick Harris (community) Needs Fixing
Devin Carlen (community) Approve
Review via email: mp+47295@code.launchpad.net

Description of the change

Fixes project and role checking when a user's naming attribute is not uid.

To post a comment you must log in.
Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
Rick Harris (rconradharris) wrote :

lgtm, but some small pep8 nits: http://paste.openstack.org/show/558/

review: Needs Fixing
lp:~rlane/nova/lp707055 updated
399. By Ryan Lane

PEP8 fixes

Revision history for this message
Ryan Lane (rlane) wrote :

Pushed PEP8 fixes

Revision history for this message
Thierry Carrez (ttx) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/auth/ldapdriver.py'
2--- nova/auth/ldapdriver.py 2011-01-20 17:52:02 +0000
3+++ nova/auth/ldapdriver.py 2011-01-24 21:29:19 +0000
4@@ -585,10 +585,11 @@
5 else:
6 return None
7
8- @staticmethod
9- def __dn_to_uid(dn):
10+ def __dn_to_uid(self, dn):
11 """Convert user dn to uid"""
12- return dn.split(',')[0].split('=')[1]
13+ query = '(objectclass=novaUser)'
14+ user = self.__find_object(dn, query)
15+ return user[FLAGS.ldap_user_id_attribute][0]
16
17
18 class FakeLdapDriver(LdapDriver):