diff options
author | Eoghan Glynn <eglynn@redhat.com> | 2012-07-06 10:10:28 +0000 |
---|---|---|
committer | Eoghan Glynn <eglynn@redhat.com> | 2012-07-10 08:26:27 +0100 |
commit | e9d21589d39355ffc126e360cc2ba7311e014edb (patch) | |
tree | 8a3942e73e0c480c3a1cc45b0e1d76bca16154aa /nova/exception.py | |
parent | ec3bcae984468b162ad40c208a81bf2b77d8b942 (diff) | |
download | nova-e9d21589d39355ffc126e360cc2ba7311e014edb.tar.gz nova-e9d21589d39355ffc126e360cc2ba7311e014edb.tar.xz nova-e9d21589d39355ffc126e360cc2ba7311e014edb.zip |
Expose over-quota exceptions via native API.
Fixes bug LP 1021373.
Previously an over-quota condition would be exposed via the EC2 API,
but hidden in the corresponding call via the native API (in the sense
of the exception detail being replaced with a generic 500 Server Error
response).
We now report any NovaException declared to be safe. In this patch,
the set of safe exception types includes any subclass of QuotaError,
but in subsequent patches the net should be widened to include
exceptions that do not expose senstive information.
Change-Id: I3cc36337c7e67cf487ca49de646c437c217ae538
Diffstat (limited to 'nova/exception.py')
-rw-r--r-- | nova/exception.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/nova/exception.py b/nova/exception.py index c1f417afe..0d570e94f 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -129,6 +129,7 @@ class NovaException(Exception): """ message = _("An unknown exception occurred.") + safe = False def __init__(self, message=None, **kwargs): self.kwargs = kwargs @@ -994,6 +995,7 @@ class WillNotSchedule(NovaException): class QuotaError(NovaException): message = _("Quota exceeded") + ": code=%(code)s" + safe = True class TooManyInstances(QuotaError): |