diff options
author | Chris Behrens <cbehrens@codestud.com> | 2011-09-07 23:24:07 -0700 |
---|---|---|
committer | Chris Behrens <cbehrens@codestud.com> | 2011-09-07 23:24:07 -0700 |
commit | be645283c85d69e2d3cf4f4eabdbb545aaf139bf (patch) | |
tree | 2c93ddb4517ee407189b12a654a15ed29395e41a | |
parent | b13ca667bdd3303bbfcd4e58cc6d773cea09661d (diff) | |
download | nova-be645283c85d69e2d3cf4f4eabdbb545aaf139bf.tar.gz nova-be645283c85d69e2d3cf4f4eabdbb545aaf139bf.tar.xz nova-be645283c85d69e2d3cf4f4eabdbb545aaf139bf.zip |
create a new exception ZoneRequestError to use for returning errors when zone requests couldn't complete
-rw-r--r-- | nova/exception.py | 7 | ||||
-rw-r--r-- | nova/scheduler/api.py | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/nova/exception.py b/nova/exception.py index 95d8229b5..aa6609461 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -806,3 +806,10 @@ class CannotResizeToSmallerSize(NovaException): class ImageTooLarge(NovaException): message = _("Image is larger than instance type allows") + + +class ZoneRequestError(Error): + def __init__(self, message=None): + if message is None: + message = _("1 or more Zones could not complete the request") + super(ZoneRequestError, self).__init__(message=message) diff --git a/nova/scheduler/api.py b/nova/scheduler/api.py index a5124678d..05685fc15 100644 --- a/nova/scheduler/api.py +++ b/nova/scheduler/api.py @@ -168,7 +168,10 @@ def child_zone_helper(zone_list, func): url = zone.api_url LOG.warn(_("Failed request to zone; URL=%(url)s: %(e)s") % locals()) - return e + # This is being returned instead of raised, so that when results are + # processed in unmarshal_result() after the greenpool.imap completes, + # the exception can be raised there if no other zones had a response. + return exception.ZoneRequestError() else: return func(nova, zone) |