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
1=== modified file 'django-nova/src/django_nova/adminclient.py'
2--- django-nova/src/django_nova/adminclient.py 2011-03-10 10:59:33 +0000
3+++ django-nova/src/django_nova/adminclient.py 2011-03-16 23:08:24 +0000
4@@ -334,12 +334,16 @@
5 def get_user(self, name):
6 """ grab a single user by name """
7 try:
8- return self.apiconn.get_object('DescribeUser', {'Name': name}, UserInfo)
9+ user = self.apiconn.get_object('DescribeUser', {'Name': name}, UserInfo)
10 except boto.exception.BotoServerError, e:
11 if e.status == 400 and e.error_code == 'NotFound':
12 return None
13 raise
14
15+ if user.username != None:
16+ return user
17+
18+
19 def has_user(self, username):
20 """ determine if user exists """
21 return self.get_user(username) != None

Subscribers

People subscribed via source and target branches