create a new exception ZoneRequestError to use for returning errors when zone requests couldn't complete
This commit is contained in:
@@ -806,3 +806,10 @@ class CannotResizeToSmallerSize(NovaException):
|
|||||||
|
|
||||||
class ImageTooLarge(NovaException):
|
class ImageTooLarge(NovaException):
|
||||||
message = _("Image is larger than instance type allows")
|
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)
|
||||||
|
|||||||
@@ -168,7 +168,10 @@ def child_zone_helper(zone_list, func):
|
|||||||
url = zone.api_url
|
url = zone.api_url
|
||||||
LOG.warn(_("Failed request to zone; URL=%(url)s: %(e)s")
|
LOG.warn(_("Failed request to zone; URL=%(url)s: %(e)s")
|
||||||
% locals())
|
% 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:
|
else:
|
||||||
return func(nova, zone)
|
return func(nova, zone)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user