Merge "Add resource fault detail in exception"
This commit is contained in:
commit
77861e2c2f
@ -137,7 +137,8 @@ class GetResourceNotFound(GetResourceFailure):
|
|||||||
|
|
||||||
|
|
||||||
class GetResourceErrorStatus(GetResourceFailure):
|
class GetResourceErrorStatus(GetResourceFailure):
|
||||||
msg_fmt = _("Resource %(resource)s has %(status)s status.")
|
msg_fmt = _("Resource %(resource)s has %(status)s status.\n"
|
||||||
|
"Fault: %(fault)s")
|
||||||
|
|
||||||
|
|
||||||
class ScriptError(RallyException):
|
class ScriptError(RallyException):
|
||||||
|
@ -85,8 +85,9 @@ def get_from_manager(error_statuses=None):
|
|||||||
if status in ("DELETED", "DELETE_COMPLETE"):
|
if status in ("DELETED", "DELETE_COMPLETE"):
|
||||||
raise exceptions.GetResourceNotFound(resource=res)
|
raise exceptions.GetResourceNotFound(resource=res)
|
||||||
if status in error_statuses:
|
if status in error_statuses:
|
||||||
raise exceptions.GetResourceErrorStatus(resource=res,
|
raise exceptions.GetResourceErrorStatus(
|
||||||
status=status)
|
resource=res, status=status,
|
||||||
|
fault=getattr(res, "fault", "n/a"))
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user