Add server_id in exception ServerUnreachable

This is to add server_id in exception ServerUnreachable for the
convenience of debugging.

Change-Id: Ib31fe70fae33d5e2eb7cda6e02b03649918a546b
This commit is contained in:
zhufl 2016-07-22 11:14:34 +08:00
parent 6bf195e555
commit 955f82b47f
3 changed files with 4 additions and 3 deletions

View File

@ -359,7 +359,7 @@ class BaseV2ComputeTest(api_version_utils.BaseMicroversionTest,
for address in addresses:
if address['version'] == CONF.validation.ip_version_for_ssh:
return address['addr']
raise exceptions.ServerUnreachable()
raise exceptions.ServerUnreachable(server_id=server['id'])
else:
raise exceptions.InvalidConfiguration()

View File

@ -63,7 +63,8 @@ class StackBuildErrorException(exceptions.TempestException):
class ServerUnreachable(exceptions.TempestException):
message = "The server is not reachable via the configured network"
message = ("Server %(server_id)s is not reachable via "
"the configured network")
# NOTE(andreaf) This exception is added here to facilitate the migration

View File

@ -664,7 +664,7 @@ class ScenarioTest(tempest.test.BaseTestCase):
for address in addresses:
if address['version'] == CONF.validation.ip_version_for_ssh:
return address['addr']
raise exceptions.ServerUnreachable()
raise exceptions.ServerUnreachable(server_id=server['id'])
else:
raise exceptions.InvalidConfiguration()