diff options
| author | Todd Willey <todd@ansolabs.com> | 2011-01-31 15:29:24 -0500 |
|---|---|---|
| committer | Todd Willey <todd@ansolabs.com> | 2011-01-31 15:29:24 -0500 |
| commit | 7ee26753b06dcf49867796fcadfa6f430bc46578 (patch) | |
| tree | ae0aba87f7032e7fec100e6c8b860f47891a75f2 /nova/adminclient.py | |
| parent | ece7d2fa493e901c2a826e42a86ca93bb0afaed4 (diff) | |
| parent | 1cd4dfe34acaec06c96925c7903a9d8dc25fe34f (diff) | |
Merge trunk and make work with provider fw rules (setup alongside basic_rules).
Diffstat (limited to 'nova/adminclient.py')
| -rw-r--r-- | nova/adminclient.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/nova/adminclient.py b/nova/adminclient.py index 9652dcb9c..f4da9f375 100644 --- a/nova/adminclient.py +++ b/nova/adminclient.py @@ -21,6 +21,7 @@ Nova User API client library. import base64 import boto +import boto.exception import httplib from boto.ec2.regioninfo import RegionInfo @@ -303,10 +304,14 @@ class NovaAdminClient(object): def get_user(self, name): """Grab a single user by name.""" - user = self.apiconn.get_object('DescribeUser', {'Name': name}, - UserInfo) - if user.username != None: - return user + 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 def has_user(self, username): """Determine if user exists.""" |
