Add and use a StackResourceBuildErrorException

wait_for_resource_status was raising a StackBuildErrorException with incorrect
parameters, leading to an unhelpful error message.

This will log the nova console to help diagnose Related-Bug: #1295396
Closes-Bug: #1295404

Change-Id: I979f9edcc0b57924fd3dd681b60165a3db311e6e
This commit is contained in:
Steve Baker 2014-03-21 11:51:25 +13:00
parent 87d1634035
commit 1ad83200eb
3 changed files with 10 additions and 2 deletions

View File

@ -94,7 +94,8 @@ class ServerCfnInitTestJSON(base.BaseOrchestrationTest):
try:
self.client.wait_for_resource_status(
sid, 'WaitCondition', 'CREATE_COMPLETE')
except exceptions.TimeoutException as e:
except (exceptions.StackResourceBuildErrorException,
exceptions.TimeoutException) as e:
# attempt to log the server console to help with debugging
# the cause of the server not signalling the waitcondition
# to heat.

View File

@ -78,6 +78,12 @@ class StackBuildErrorException(base.TempestException):
"due to '%(stack_status_reason)s'")
class StackResourceBuildErrorException(base.TempestException):
message = ("Resource %(resource_name) in stack %(stack_identifier)s is "
"in %(resource_status)s status due to "
"'%(resource_status_reason)s'")
class BadRequest(base.RestClientException):
message = "Bad request"

View File

@ -154,7 +154,8 @@ class OrchestrationClient(rest_client.RestClient):
if resource_status == status:
return
if fail_regexp.search(resource_status):
raise exceptions.StackBuildErrorException(
raise exceptions.StackResourceBuildErrorException(
resource_name=resource_name,
stack_identifier=stack_identifier,
resource_status=resource_status,
resource_status_reason=body['resource_status_reason'])