From 955f82b47fa364d445c8e6f11d361bc7d7875557 Mon Sep 17 00:00:00 2001 From: zhufl Date: Fri, 22 Jul 2016 11:14:34 +0800 Subject: [PATCH] Add server_id in exception ServerUnreachable This is to add server_id in exception ServerUnreachable for the convenience of debugging. Change-Id: Ib31fe70fae33d5e2eb7cda6e02b03649918a546b --- tempest/api/compute/base.py | 2 +- tempest/exceptions.py | 3 ++- tempest/scenario/manager.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py index 37aa5ac129..5e7549381c 100644 --- a/tempest/api/compute/base.py +++ b/tempest/api/compute/base.py @@ -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() diff --git a/tempest/exceptions.py b/tempest/exceptions.py index f534f30a83..67ad4b7fab 100644 --- a/tempest/exceptions.py +++ b/tempest/exceptions.py @@ -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 diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py index f889c449b5..b1513751b2 100644 --- a/tempest/scenario/manager.py +++ b/tempest/scenario/manager.py @@ -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()