Add missing message parameter to LOG.exception call

Without the parameter call fails, see referenced bug for example.

Change-Id: Iaba6290ec92aabc8c9a0336dd3d6bf30de81ac3e
Closes-Bug: #1652281
This commit is contained in:
Dmitry Mescheryakov 2016-12-23 15:36:20 +04:00
parent e71059ac4d
commit ca43f60770
7 changed files with 24 additions and 24 deletions

View File

@ -473,7 +473,7 @@ class CeilometerBaseTest(fuel_health.nmanager.PlatformServicesBaseClass):
try: try:
method(resource) method(resource)
except Exception: except Exception:
LOG.exception() LOG.exception("")
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):

View File

@ -190,7 +190,7 @@ def cleanup(cluster_deployment_info):
LOG.info('Delete server with name {0}'.format(s.name)) LOG.info('Delete server with name {0}'.format(s.name))
manager._get_compute_client().servers.delete(s.id) manager._get_compute_client().servers.delete(s.id)
except Exception: except Exception:
LOG.exception() LOG.exception("")
else: else:
LOG.info('No servers found') LOG.info('No servers found')
@ -232,12 +232,12 @@ def _delete_it(client, log_message, name='ost1_test-', delete_type='name'):
else: else:
client.delete(item.id) client.delete(item.id)
except Exception: except Exception:
LOG.exception() LOG.exception("")
except AttributeError: except AttributeError:
if item.display_name.startswith(name): if item.display_name.startswith(name):
client.delete(item) client.delete(item)
except Exception: except Exception:
LOG.exception() LOG.exception("")
if __name__ == "__main__": if __name__ == "__main__":

View File

@ -169,7 +169,7 @@ class Client(object):
connection = self._get_ssh_connection() connection = self._get_ssh_connection()
connection.close() connection.close()
except paramiko.AuthenticationException: except paramiko.AuthenticationException:
LOG.exception() LOG.exception("")
return False return False
return True return True

View File

@ -29,42 +29,42 @@ LOG = logging.getLogger(__name__)
try: try:
import heatclient.v1.client import heatclient.v1.client
except Exception: except Exception:
LOG.exception() LOG.exception("")
LOG.warning('Heatclient could not be imported.') LOG.warning('Heatclient could not be imported.')
try: try:
import muranoclient.v1.client import muranoclient.v1.client
except Exception: except Exception:
LOG.exception() LOG.exception("")
LOG.warning('Muranoclient could not be imported.') LOG.warning('Muranoclient could not be imported.')
try: try:
import saharaclient.client import saharaclient.client
except Exception: except Exception:
LOG.exception() LOG.exception("")
LOG.warning('Sahara client could not be imported.') LOG.warning('Sahara client could not be imported.')
try: try:
import ceilometerclient.v2.client import ceilometerclient.v2.client
except Exception: except Exception:
LOG.exception() LOG.exception("")
LOG.warning('Ceilometer client could not be imported.') LOG.warning('Ceilometer client could not be imported.')
try: try:
import neutronclient.neutron.client import neutronclient.neutron.client
except Exception: except Exception:
LOG.exception() LOG.exception("")
LOG.warning('Neutron client could not be imported.') LOG.warning('Neutron client could not be imported.')
try: try:
import glanceclient import glanceclient
except Exception: except Exception:
LOG.exception() LOG.exception("")
LOG.warning('Glance client could not be imported') LOG.warning('Glance client could not be imported')
try: try:
import ironicclient import ironicclient
except Exception: except Exception:
LOG.exception() LOG.exception("")
LOG.warning('Ironic client could not be imported') LOG.warning('Ironic client could not be imported')
try: try:
import muranoclient.glance.client as art_client import muranoclient.glance.client as art_client
except Exception: except Exception:
LOG.exception() LOG.exception("")
LOG.warning('Artifacts client could not be imported') LOG.warning('Artifacts client could not be imported')
import aodhclient.client import aodhclient.client
@ -511,7 +511,7 @@ class OfficialClientTest(fuel_health.test.TestCase):
.format(image=self.manager.config.compute.image_name) .format(image=self.manager.config.compute.image_name)
) )
except nova_exc.ClientException: except nova_exc.ClientException:
LOG.exception() LOG.exception("")
self.fail("Image can not be retrieved. " self.fail("Image can not be retrieved. "
"Please refer to OpenStack logs for more details") "Please refer to OpenStack logs for more details")
@ -614,7 +614,7 @@ class NovaNetworkScenarioTest(OfficialClientTest):
timeout=self.timeout) timeout=self.timeout)
return sshclient.exec_longrun_command(cmd) return sshclient.exec_longrun_command(cmd)
except Exception: except Exception:
LOG.exception() LOG.exception("")
self.fail("%s command failed." % cmd) self.fail("%s command failed." % cmd)
def _create_keypair(self, client, namestart='ost1_test-keypair-smoke-'): def _create_keypair(self, client, namestart='ost1_test-keypair-smoke-'):
@ -665,7 +665,7 @@ class NovaNetworkScenarioTest(OfficialClientTest):
try: try:
client.security_group_rules.create(secgroup.id, **ruleset) client.security_group_rules.create(secgroup.id, **ruleset)
except Exception: except Exception:
LOG.exception() LOG.exception("")
self.fail("Failed to create rule in security group.") self.fail("Failed to create rule in security group.")
return secgroup return secgroup
@ -803,7 +803,7 @@ class NovaNetworkScenarioTest(OfficialClientTest):
try: try:
client.servers.add_floating_ip(server, floating_ip) client.servers.add_floating_ip(server, floating_ip)
except Exception: except Exception:
LOG.exception() LOG.exception("")
self.fail('Can not assign floating ip to instance') self.fail('Can not assign floating ip to instance')
@classmethod @classmethod
@ -829,7 +829,7 @@ class NovaNetworkScenarioTest(OfficialClientTest):
key_filename=self.key, key_filename=self.key,
timeout=timeout) timeout=timeout)
except Exception: except Exception:
LOG.exception() LOG.exception("")
return self.retry_command(retries=retries[0], return self.retry_command(retries=retries[0],
timeout=retries[1], timeout=retries[1],
@ -860,7 +860,7 @@ class NovaNetworkScenarioTest(OfficialClientTest):
timeout=timeout) timeout=timeout)
except Exception: except Exception:
LOG.exception() LOG.exception("")
command = "ping -q -c1 -w10 8.8.8.8" command = "ping -q -c1 -w10 8.8.8.8"
@ -891,7 +891,7 @@ class NovaNetworkScenarioTest(OfficialClientTest):
LOG.debug('Host is {0}'.format(host)) LOG.debug('Host is {0}'.format(host))
except Exception: except Exception:
LOG.exception() LOG.exception("")
return self.retry_command(retries[0], retries[1], return self.retry_command(retries[0], retries[1],
ssh.exec_command_on_vm, ssh.exec_command_on_vm,

View File

@ -82,7 +82,7 @@ class SanityInfrastructureTest(nmanager.SanityChecksTest):
'Step 2 failed: Some nova services have not been started.') 'Step 2 failed: Some nova services have not been started.')
except Exception: except Exception:
LOG.info("Will sleep for 120 seconds and try again") LOG.info("Will sleep for 120 seconds and try again")
LOG.exception() LOG.exception("")
time.sleep(120) time.sleep(120)
# Re-collect data silently # Re-collect data silently
output = get_controllers_down_states() output = get_controllers_down_states()

View File

@ -128,6 +128,6 @@ class TestUserTenantRole(nmanager.SmokeChecksTest):
"logs for more details.", "logs for more details.",
failed_step=9) failed_step=9)
except Exception: except Exception:
LOG.exception() LOG.exception("")
self.fail("Step 10 failed: Can not authenticate in Horizon. " self.fail("Step 10 failed: Can not authenticate in Horizon. "
"Please refer to OpenStack logs for more details.") "Please refer to OpenStack logs for more details.")

View File

@ -227,7 +227,7 @@ class TestVcenter(nmanager.NovaNetworkScenarioTest):
if addr.startswith('novanetwork'): if addr.startswith('novanetwork'):
instance_ip = server.addresses[addr][0]['addr'] instance_ip = server.addresses[addr][0]['addr']
except Exception: except Exception:
LOG.exception() LOG.exception("")
self.fail("Step 3 failed: cannot get instance details. " self.fail("Step 3 failed: cannot get instance details. "
"Please refer to OpenStack logs for more details.") "Please refer to OpenStack logs for more details.")
@ -285,7 +285,7 @@ class TestVcenterImageAction(nmanager.SmokeChecksTest):
if e.__class__.__name__ == 'NotFound': if e.__class__.__name__ == 'NotFound':
return True return True
self.error_msg.append(e) self.error_msg.append(e)
LOG.exception() LOG.exception("")
return False return False
# Block until resource deletion has completed or timed-out # Block until resource deletion has completed or timed-out