summaryrefslogtreecommitdiffstats
path: root/nova/exception.py
diff options
context:
space:
mode:
authorLorin Hochstein <lorin@isi.edu>2011-06-16 16:48:20 -0400
committerLorin Hochstein <lorin@isi.edu>2011-06-16 16:48:20 -0400
commita51b2ed4ed4840262bd07d5dfc11e33a32e1accd (patch)
tree1364ed7aac86f805ddba903efa0b43afc6e61112 /nova/exception.py
parentd68f6de8d8275ec6dd9f231b9b52971f2ad15263 (diff)
parent1763419a3f6b01bb0ef98c700f0f350e756b359c (diff)
downloadnova-a51b2ed4ed4840262bd07d5dfc11e33a32e1accd.tar.gz
nova-a51b2ed4ed4840262bd07d5dfc11e33a32e1accd.tar.xz
nova-a51b2ed4ed4840262bd07d5dfc11e33a32e1accd.zip
Upstream merge
Diffstat (limited to 'nova/exception.py')
-rw-r--r--nova/exception.py30
1 files changed, 28 insertions, 2 deletions
diff --git a/nova/exception.py b/nova/exception.py
index 394004fe6..c08e47efe 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))
@@ -122,7 +122,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):
@@ -291,6 +291,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.")
@@ -367,6 +376,10 @@ class NoFloatingIpsDefinedForInstance(NoFloatingIpsDefined):
message = _("Zero floating ips defined for instance %(instance_id)s.")
+class NoMoreFloatingIps(NotFound):
+ message = _("Zero floating ips available.")
+
+
class KeypairNotFound(NotFound):
message = _("Keypair %(keypair_name)s not found for user %(user_id)s")
@@ -477,6 +490,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.")
@@ -568,3 +590,7 @@ class InstanceExists(Duplicate):
class MigrationError(NovaException):
message = _("Migration error") + ": %(reason)s"
+
+
+class MalformedRequestBody(NovaException):
+ message = _("Malformed message body: %(reason)s")