summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevin Carlen <devin.carlen@gmail.com>2011-03-28 18:45:56 +0000
committerTarmac <>2011-03-28 18:45:56 +0000
commitddbb00fc3c3a2fe74234298a206d2e6a91513a33 (patch)
tree5d501f17a2fd717fbff15890ec9c6a18bc0cc129
parent191a2086d94dfb34c43738ec9b702763354f314a (diff)
parentceb8cd14f968aa063bd6a19999340f77c5603568 (diff)
downloadnova-ddbb00fc3c3a2fe74234298a206d2e6a91513a33.tar.gz
nova-ddbb00fc3c3a2fe74234298a206d2e6a91513a33.tar.xz
nova-ddbb00fc3c3a2fe74234298a206d2e6a91513a33.zip
Fixed DescribeUser in the ec2 admin client to return None instead of an empty UserInfo object.
-rw-r--r--nova/adminclient.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/nova/adminclient.py b/nova/adminclient.py
index fc3c5c5fe..f570e12c2 100644
--- a/nova/adminclient.py
+++ b/nova/adminclient.py
@@ -324,14 +324,11 @@ class NovaAdminClient(object):
def get_user(self, name):
"""Grab a single user by name."""
- try:
- return self.apiconn.get_object('DescribeUser',
- {'Name': name},
- UserInfo)
- except boto.exception.BotoServerError, e:
- if e.status == 400 and e.error_code == 'NotFound':
- return None
- raise
+ user = self.apiconn.get_object('DescribeUser',
+ {'Name': name},
+ UserInfo)
+ if user.username != None:
+ return user
def has_user(self, username):
"""Determine if user exists."""