summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJustin Santa Barbara <justin@fathomdb.com>2011-03-18 18:07:24 +0000
committerTarmac <>2011-03-18 18:07:24 +0000
commitc983f80c60b2c5714926a664d45d3fcd6bcf0438 (patch)
tree4824c8361de19a61633d4812d4096df6558a5c5c /nova/api
parent7e299ece0600e19d062bb28867e0809c48ac12a0 (diff)
parent48a1423081355b49340aa1a4a37361654d9c0d87 (diff)
Cleanup of FakeAuthManager
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/users.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/nova/api/openstack/users.py b/nova/api/openstack/users.py
index ebd0f4512..d3ab3d553 100644
--- a/nova/api/openstack/users.py
+++ b/nova/api/openstack/users.py
@@ -13,13 +13,14 @@
# License for the specific language governing permissions and limitations
# under the License.
-import common
+from webob import exc
from nova import exception
from nova import flags
from nova import log as logging
from nova import wsgi
-
+from nova.api.openstack import common
+from nova.api.openstack import faults
from nova.auth import manager
FLAGS = flags.FLAGS
@@ -63,7 +64,17 @@ class Controller(wsgi.Controller):
def show(self, req, id):
"""Return data about the given user id"""
- user = self.manager.get_user(id)
+
+ #NOTE(justinsb): The drivers are a little inconsistent in how they
+ # deal with "NotFound" - some throw, some return None.
+ try:
+ user = self.manager.get_user(id)
+ except exception.NotFound:
+ user = None
+
+ if user is None:
+ raise faults.Fault(exc.HTTPNotFound())
+
return dict(user=_translate_keys(user))
def delete(self, req, id):