Fixed DescribeUser in the ec2 admin client to return None instead of an empty UserInfo object.
This commit is contained in:
@@ -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."""
|
||||
|
Reference in New Issue
Block a user