Merge lp:~devcamcar/horizon/lp735759 into lp:~hudson-openstack/horizon/trunk

Proposed by Devin Carlen
Status: Merged
Approved by: Devin Carlen
Approved revision: 25
Merged at revision: 23
Proposed branch: lp:~devcamcar/horizon/lp735759
Merge into: lp:~hudson-openstack/horizon/trunk
Diff against target: 21 lines (+5/-1)
1 file modified
django-nova/src/django_nova/adminclient.py (+5/-1)
To merge this branch: bzr merge lp:~devcamcar/horizon/lp735759
Reviewer Review Type Date Requested Status
Devin Carlen Approve
Review via email: mp+53715@code.launchpad.net

Commit message

Fixed an issue where some auth drivers would cause get_user to fail.

Description of the change

DbDriver and LdapDriver behave differently so my original fix was insufficient. This branch covers all cases.

To post a comment you must log in.
lp:~devcamcar/horizon/lp735759 updated
25. By Devin Carlen

Patch to make get_user work with all auth drivers

Revision history for this message
Devin Carlen (devcamcar) wrote :

approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'django-nova/src/django_nova/adminclient.py'
--- django-nova/src/django_nova/adminclient.py 2011-03-10 10:59:33 +0000
+++ django-nova/src/django_nova/adminclient.py 2011-03-16 23:08:24 +0000
@@ -334,12 +334,16 @@
334 def get_user(self, name):334 def get_user(self, name):
335 """ grab a single user by name """335 """ grab a single user by name """
336 try:336 try:
337 return self.apiconn.get_object('DescribeUser', {'Name': name}, UserInfo)337 user = self.apiconn.get_object('DescribeUser', {'Name': name}, UserInfo)
338 except boto.exception.BotoServerError, e:338 except boto.exception.BotoServerError, e:
339 if e.status == 400 and e.error_code == 'NotFound':339 if e.status == 400 and e.error_code == 'NotFound':
340 return None340 return None
341 raise341 raise
342342
343 if user.username != None:
344 return user
345
346
343 def has_user(self, username):347 def has_user(self, username):
344 """ determine if user exists """348 """ determine if user exists """
345 return self.get_user(username) != None349 return self.get_user(username) != None

Subscribers

People subscribed via source and target branches