diff options
author | Adam Gandelman <adamg@canonical.com> | 2012-03-13 16:23:45 -0700 |
---|---|---|
committer | Adam Gandelman <adamg@canonical.com> | 2012-03-14 11:30:02 -0700 |
commit | 9363d5fea676e1e083c5afe5287ef30c806046bf (patch) | |
tree | 9be554108ab100c0f645a92d770b661ed2cdb261 /keystone/exception.py | |
parent | acc9f892b36aa7315ac84d1e7f6506a6fea9fbad (diff) | |
download | keystone-9363d5fea676e1e083c5afe5287ef30c806046bf.tar.gz keystone-9363d5fea676e1e083c5afe5287ef30c806046bf.tar.xz keystone-9363d5fea676e1e083c5afe5287ef30c806046bf.zip |
Properly return 501 for unsupported Catalog calls
Similar to the other APIs, this creates a Driver class that describes
expected functionality of the catalog driver and raises NotImplemented
accordingly. NotImplementedError()'s are caught and returned as proper
501s instead of AttributeErrors.
Also fixes some inconsistent paramters names in the sql backend.
Fixes bug 954087
Update: Convert usage of NotImplementedError() to new
keystone.exception.NotImplemented() for all
unimplemented driver actions.
Change-Id: I69d8e21a6f651e69b724ec5ed5784645bad80c00
Diffstat (limited to 'keystone/exception.py')
-rw-r--r-- | keystone/exception.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/keystone/exception.py b/keystone/exception.py index 115006e3..d95a75e0 100644 --- a/keystone/exception.py +++ b/keystone/exception.py @@ -69,5 +69,11 @@ class NotFound(Error): title = 'Not Found' +class NotImplemented(Error): + """The action you have requested has not been implemented.""" + code = 501 + action = 'Not Implemented' + + class TokenNotFound(NotFound): """Could not find token: %(token_id)s""" |