summaryrefslogtreecommitdiffstats
path: root/nova/exception.py
diff options
context:
space:
mode:
authorTrey Morris <trey.morris@rackspace.com>2011-06-03 13:34:54 -0500
committerTrey Morris <trey.morris@rackspace.com>2011-06-03 13:34:54 -0500
commit65e17925fc3dee9180fd0198475e4ffd7be2aa48 (patch)
tree049d3ee0934be84022ada50fe18928150699b3a3 /nova/exception.py
parent3db24f73cd5772537b9508304f8db8a7bb64f5ca (diff)
parent54c341feff5043a11cfccc6e2eb02b1bf0669348 (diff)
downloadnova-65e17925fc3dee9180fd0198475e4ffd7be2aa48.tar.gz
nova-65e17925fc3dee9180fd0198475e4ffd7be2aa48.tar.xz
nova-65e17925fc3dee9180fd0198475e4ffd7be2aa48.zip
merged trunk again
Diffstat (limited to 'nova/exception.py')
-rw-r--r--nova/exception.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/nova/exception.py b/nova/exception.py
index f63200a63..1aab66c05 100644
--- a/nova/exception.py
+++ b/nova/exception.py
@@ -65,7 +65,7 @@ class BuildInProgress(Error):
class DBError(Error):
"""Wraps an implementation specific exception."""
- def __init__(self, inner_exception):
+ def __init__(self, inner_exception=None):
self.inner_exception = inner_exception
super(DBError, self).__init__(str(inner_exception))
@@ -126,7 +126,7 @@ class NotAuthorized(NovaException):
message = _("Not authorized.")
def __init__(self, *args, **kwargs):
- super(NotFound, self).__init__(**kwargs)
+ super(NotAuthorized, self).__init__(**kwargs)
class AdminRequired(NotAuthorized):
@@ -295,6 +295,15 @@ class DiskNotFound(NotFound):
message = _("No disk at %(location)s")
+class InvalidImageRef(Invalid):
+ message = _("Invalid image href %(image_href)s.")
+
+
+class ListingImageRefsNotSupported(Invalid):
+ message = _("Some images have been stored via hrefs."
+ + " This version of the api does not support displaying image hrefs.")
+
+
class ImageNotFound(NotFound):
message = _("Image %(image_id)s could not be found.")
@@ -497,6 +506,15 @@ class SchedulerHostFilterNotFound(NotFound):
message = _("Scheduler Host Filter %(filter_name)s could not be found.")
+class SchedulerCostFunctionNotFound(NotFound):
+ message = _("Scheduler cost function %(cost_fn_str)s could"
+ " not be found.")
+
+
+class SchedulerWeightFlagNotFound(NotFound):
+ message = _("Scheduler weight flag not found: %(flag_name)s")
+
+
class InstanceMetadataNotFound(NotFound):
message = _("Instance %(instance_id)s has no metadata with "
"key %(metadata_key)s.")