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
=== modified file 'nova/auth/ldapdriver.py'
--- nova/auth/ldapdriver.py 2011-01-20 17:52:02 +0000
+++ nova/auth/ldapdriver.py 2011-01-24 21:29:19 +0000
@@ -585,10 +585,11 @@
585 else:585 else:
586 return None586 return None
587587
588 @staticmethod588 def __dn_to_uid(self, dn):
589 def __dn_to_uid(dn):
590 """Convert user dn to uid"""589 """Convert user dn to uid"""
591 return dn.split(',')[0].split('=')[1]590 query = '(objectclass=novaUser)'
591 user = self.__find_object(dn, query)
592 return user[FLAGS.ldap_user_id_attribute][0]
592593
593594
594class FakeLdapDriver(LdapDriver):595class FakeLdapDriver(LdapDriver):