Log identifiers of resources being cleaned up

On teardown compute API tests clean up resources such as servers
and images. This patch simply logs the identifiers of these
resources in order to help debugging failures which might originate
from problems during cleanup.

Change-Id: Ied2924bba78ec8f4a3b51df1be69273b28362475
Related-Bug: #1357055
This commit is contained in:
Salvatore 2014-10-08 15:53:25 +02:00 committed by taturiello
parent c7430c2ac5
commit 1422a9ac6c
1 changed files with 6 additions and 0 deletions

View File

@ -142,6 +142,8 @@ class BaseComputeTest(tempest.test.BaseTestCase):
@classmethod
def clear_servers(cls):
LOG.debug('Clearing servers: %s', ','.join(
server['id'] for server in cls.servers))
for server in cls.servers:
try:
cls.servers_client.delete_server(server['id'])
@ -181,6 +183,7 @@ class BaseComputeTest(tempest.test.BaseTestCase):
@classmethod
def clear_images(cls):
LOG.debug('Clearing images: %s', ','.join(cls.images))
for image_id in cls.images:
try:
cls.images_client.delete_image(image_id)
@ -192,6 +195,8 @@ class BaseComputeTest(tempest.test.BaseTestCase):
@classmethod
def clear_security_groups(cls):
LOG.debug('Clearing security groups: %s', ','.join(
str(sg['id']) for sg in cls.security_groups))
for sg in cls.security_groups:
try:
resp, body =\
@ -206,6 +211,7 @@ class BaseComputeTest(tempest.test.BaseTestCase):
@classmethod
def clear_server_groups(cls):
LOG.debug('Clearing server groups: %s', ','.join(cls.server_groups))
for server_group_id in cls.server_groups:
try:
cls.client.delete_server_group(server_group_id)