Merge "Increase exception log details"
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 093754c..b060f15 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -100,9 +100,8 @@
except exceptions.NotFound:
# The image may have already been deleted which is OK.
pass
- except Exception as exc:
- LOG.info('Exception raised deleting image %s', image_id)
- LOG.exception(exc)
+ except Exception:
+ LOG.exception('Exception raised deleting image %s' % image_id)
pass
@classmethod
@@ -214,8 +213,8 @@
try:
cls.servers_client.delete_server(server_id)
cls.servers_client.wait_for_server_termination(server_id)
- except Exception as exc:
- LOG.exception(exc)
+ except Exception:
+ LOG.exception('Failed to delete server %s' % server_id)
pass
resp, server = cls.create_test_server(wait_until='ACTIVE', **kwargs)
cls.password = server['adminPass']
@@ -300,8 +299,8 @@
try:
cls.servers_client.delete_server(server_id)
cls.servers_client.wait_for_server_termination(server_id)
- except Exception as exc:
- LOG.exception(exc)
+ except Exception:
+ LOG.exception('Failed to delete server %s' % server_id)
pass
resp, server = cls.create_test_server(wait_until='ACTIVE', **kwargs)
cls.password = server['admin_password']
diff --git a/tempest/api/compute/images/test_images_oneserver.py b/tempest/api/compute/images/test_images_oneserver.py
index c711bd5..26cc3f6 100644
--- a/tempest/api/compute/images/test_images_oneserver.py
+++ b/tempest/api/compute/images/test_images_oneserver.py
@@ -46,10 +46,11 @@
try:
self.servers_client.wait_for_server_status(self.server_id,
'ACTIVE')
- except Exception as exc:
- LOG.exception(exc)
+ except Exception:
+ LOG.exception('server %s timed out to become ACTIVE. rebuilding'
+ % self.server_id)
# Rebuild server if cannot reach the ACTIVE state
- # Usually it means the server had a serius accident
+ # Usually it means the server had a serious accident
self.__class__.server_id = self.rebuild_server(self.server_id)
@classmethod
diff --git a/tempest/api/compute/images/test_images_oneserver_negative.py b/tempest/api/compute/images/test_images_oneserver_negative.py
index b8a4304..5e235d1 100644
--- a/tempest/api/compute/images/test_images_oneserver_negative.py
+++ b/tempest/api/compute/images/test_images_oneserver_negative.py
@@ -45,10 +45,11 @@
try:
self.servers_client.wait_for_server_status(self.server_id,
'ACTIVE')
- except Exception as exc:
- LOG.exception(exc)
+ except Exception:
+ LOG.exception('server %s timed out to become ACTIVE. rebuilding'
+ % self.server_id)
# Rebuild server if cannot reach the ACTIVE state
- # Usually it means the server had a serius accident
+ # Usually it means the server had a serious accident
self._reset_server()
def _reset_server(self):
diff --git a/tempest/api/compute/images/test_list_image_filters.py b/tempest/api/compute/images/test_list_image_filters.py
index ac2ecba..bfdd8b2 100644
--- a/tempest/api/compute/images/test_list_image_filters.py
+++ b/tempest/api/compute/images/test_list_image_filters.py
@@ -59,8 +59,8 @@
resp, cls.image2 = cls.create_image_from_server(
cls.server1['id'], wait_until='ACTIVE')
cls.image2_id = cls.image2['id']
- except Exception as exc:
- LOG.exception(exc)
+ except Exception:
+ LOG.exception('setUpClass failed')
cls.tearDownClass()
raise
diff --git a/tempest/api/volume/test_volumes_list.py b/tempest/api/volume/test_volumes_list.py
index be735a4..49a2f74 100644
--- a/tempest/api/volume/test_volumes_list.py
+++ b/tempest/api/volume/test_volumes_list.py
@@ -72,8 +72,9 @@
resp, volume = cls.client.get_volume(volume['id'])
cls.volume_list.append(volume)
cls.volume_id_list.append(volume['id'])
- except Exception as exc:
- LOG.exception(exc)
+ except Exception:
+ LOG.exception('Failed to create volume. %d volumes were '
+ 'created' % len(cls.volume_id_list))
if cls.volume_list:
# We could not create all the volumes, though we were able
# to create *some* of the volumes. This is typically
@@ -82,7 +83,7 @@
for volid in cls.volume_id_list:
cls.client.delete_volume(volid)
cls.client.wait_for_resource_deletion(volid)
- raise exc
+ raise
@classmethod
def tearDownClass(cls):
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index 33dd6c0..3618a14 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -227,10 +227,10 @@
for ip_address in ip_addresses:
self._check_vm_connectivity(ip_address, ssh_login,
key.private_key)
- except Exception as exc:
- LOG.exception(exc)
+ except Exception:
+ LOG.exception('Tenant connectivity check failed')
debug.log_ip_ns()
- raise exc
+ raise
def _wait_for_floating_ip_association(self):
ip_tracker = FloatingIPCheckTracker(self.compute_client,
@@ -263,10 +263,10 @@
ssh_login,
private_key,
should_connect=should_connect)
- except Exception as exc:
- LOG.exception(exc)
+ except Exception:
+ LOG.exception('Public network connectivity check failed')
debug.log_ip_ns()
- raise exc
+ raise
def _disassociate_floating_ips(self):
for floating_ip, server in self.floating_ips.iteritems():
diff --git a/tempest/thirdparty/boto/test.py b/tempest/thirdparty/boto/test.py
index 2f7a650..2ce5cce 100644
--- a/tempest/thirdparty/boto/test.py
+++ b/tempest/thirdparty/boto/test.py
@@ -245,20 +245,20 @@
@classmethod
def tearDownClass(cls):
"""Calls the callables added by addResourceCleanUp,
- when you overwire this function dont't forget to call this too.
+ when you overwrite this function don't forget to call this too.
"""
fail_count = 0
trash_keys = sorted(cls._resource_trash_bin, reverse=True)
for key in trash_keys:
(function, pos_args, kw_args) = cls._resource_trash_bin[key]
try:
- LOG.debug("Cleaning up: %s" %
- friendly_function_call_str(function, *pos_args,
- **kw_args))
+ func_name = friendly_function_call_str(function, *pos_args,
+ **kw_args)
+ LOG.debug("Cleaning up: %s" % func_name)
function(*pos_args, **kw_args)
- except BaseException as exc:
+ except BaseException:
fail_count += 1
- LOG.exception(exc)
+ LOG.exception("Cleanup failed %s" % func_name)
finally:
del cls._resource_trash_bin[key]
super(BotoTestCase, cls).tearDownClass()
@@ -428,12 +428,12 @@
try:
bucket.delete_key(obj.key)
obj.close()
- except BaseException as exc:
- LOG.exception(exc)
+ except BaseException:
+ LOG.exception("Failed to delete key %s " % obj.key)
exc_num += 1
conn.delete_bucket(bucket)
- except BaseException as exc:
- LOG.exception(exc)
+ except BaseException:
+ LOG.exception("Failed to destroy bucket %s " % bucket)
exc_num += 1
if exc_num:
raise exceptions.TearDownException(num=exc_num)
@@ -463,8 +463,8 @@
try:
instance.terminate()
re_search_wait(_instance_state, "_GONE")
- except BaseException as exc:
- LOG.exception(exc)
+ except BaseException:
+ LOG.exception("Failed to terminate instance %s " % instance)
exc_num += 1
if exc_num:
raise exceptions.TearDownException(num=exc_num)
@@ -497,8 +497,8 @@
try:
if volume.status != "available":
volume.detach(force=True)
- except BaseException as exc:
- LOG.exception(exc)
+ except BaseException:
+ LOG.exception("Failed to detach volume %s" % volume)
# exc_num += 1 "nonlocal" not in python2
return volume.status
@@ -506,8 +506,8 @@
re_search_wait(_volume_state, "available") # not validates status
LOG.info(_volume_state())
volume.delete()
- except BaseException as exc:
- LOG.exception(exc)
+ except BaseException:
+ LOG.exception("Failed to delete volume %s" % volume)
exc_num += 1
if exc_num:
raise exceptions.TearDownException(num=exc_num)