Bugfix: initialize the logger for snaps
authorLinda Wang <wangwulin@huawei.com>
Mon, 8 May 2017 06:33:13 +0000 (06:33 +0000)
committerLinda Wang <wangwulin@huawei.com>
Tue, 9 May 2017 02:15:25 +0000 (02:15 +0000)
Testcases about snaps failed due to the absence of attribute 'logger'.

Change-Id: I78c85e51f63afa767fa73aa12faea066ad432371
Signed-off-by: Linda Wang <wangwulin@huawei.com>
functest/core/pytest_suite_runner.py
functest/opnfv_tests/openstack/snaps/snaps_test_runner.py

index 8b5da05..21edc18 100644 (file)
@@ -18,6 +18,7 @@ class PyTestSuiteRunner(base.TestCase):
     def __init__(self, **kwargs):
         super(PyTestSuiteRunner, self).__init__(**kwargs)
         self.suite = None
+        self.logger = None
 
     def run(self, **kwargs):
         """
index 8a68cad..2a1b3a3 100644 (file)
@@ -5,6 +5,8 @@
 #
 # http://www.apache.org/licenses/LICENSE-2.0
 
+import logging
+
 from functest.core.pytest_suite_runner import PyTestSuiteRunner
 from functest.opnfv_tests.openstack.snaps import snaps_utils
 from functest.utils import functest_utils
@@ -22,6 +24,7 @@ class SnapsTestRunner(PyTestSuiteRunner):
     """
     def __init__(self, **kwargs):
         super(SnapsTestRunner, self).__init__(**kwargs)
+        self.logger = logging.getLogger(__name__)
 
         self.os_creds = openstack_tests.get_credentials(
             os_env_file=CONST.__getattribute__('openstack_creds'),