From fd18d52e94cc293c32bb7f69a00ec4604bdace0e Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Sat, 21 Apr 2018 12:52:29 +0200 Subject: Switch from deploy utils to the right objects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It also prints the full exceptions and removes useless casts. Change-Id: I19ff1ae90670833f998c0d17592da82207235229 Signed-off-by: Cédric Ollivier --- functest/opnfv_tests/openstack/vping/vping_ssh.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'functest/opnfv_tests/openstack/vping/vping_ssh.py') diff --git a/functest/opnfv_tests/openstack/vping/vping_ssh.py b/functest/opnfv_tests/openstack/vping/vping_ssh.py index 7cdcd2576..93c9c0976 100644 --- a/functest/opnfv_tests/openstack/vping/vping_ssh.py +++ b/functest/opnfv_tests/openstack/vping/vping_ssh.py @@ -9,6 +9,7 @@ """vPingSSH testcase.""" +import logging import time from scp import SCPClient @@ -29,6 +30,7 @@ from functest.utils import config class VPingSSH(vping_base.VPingBase): + # pylint: disable=too-many-instance-attributes """ VPingSSH testcase implementation. @@ -41,6 +43,7 @@ class VPingSSH(vping_base.VPingBase): if "case_name" not in kwargs: kwargs["case_name"] = "vping_ssh" super(VPingSSH, self).__init__(**kwargs) + self.logger = logging.getLogger(__name__) self.kp_name = getattr(config.CONF, 'vping_keypair_name') + self.guid self.kp_priv_file = getattr(config.CONF, 'vping_keypair_priv_file') @@ -120,8 +123,8 @@ class VPingSSH(vping_base.VPingBase): self.creators.append(self.vm2_creator) return self._execute() - except Exception as exc: # pylint: disable=broad-except - self.logger.error('Unexpected error running test - ' + exc.message) + except Exception: # pylint: disable=broad-except + self.logger.exception('Unexpected error running test') return testcase.TestCase.EX_RUN_ERROR def _do_vping(self, vm_creator, test_ip): -- cgit 1.2.3-korg