diff options
| author | Todd Willey <todd@ansolabs.com> | 2011-06-11 14:46:08 -0400 |
|---|---|---|
| committer | Todd Willey <todd@ansolabs.com> | 2011-06-11 14:46:08 -0400 |
| commit | 85bfd9592f8a49d2a730e64f9bf58e395d8965c7 (patch) | |
| tree | 471c3fb453abd68b025d69df39bf7f635fdb2add /nova/exception.py | |
| parent | 0bcb15317fede5c17c77c187e1cd9a68a0c8030c (diff) | |
| parent | 91e34d37d2907295e892e96ca2c3039c7fbe14bf (diff) | |
Merge and resolve.
Diffstat (limited to 'nova/exception.py')
| -rw-r--r-- | nova/exception.py | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/nova/exception.py b/nova/exception.py index d3d58f3b2..1571dd032 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.") |
