From a2c96362067e32d569b8a02ca0ec022195e54b35 Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Wed, 27 Apr 2016 16:28:55 +0200 Subject: Replace all the loggers by the functest logger module JIRA: FUNCTEST-228 Change-Id: If7a3c8cb08e9fbdf155fc5eff5330f79e5f8d234 Signed-off-by: jose.lausuch --- testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py | 16 ++-------------- testcases/VIM/OpenStack/CI/libraries/run_tempest.py | 16 ++-------------- 2 files changed, 4 insertions(+), 28 deletions(-) (limited to 'testcases/VIM/OpenStack/CI/libraries') diff --git a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py index 6c753b024..4acc432bc 100755 --- a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py +++ b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py @@ -16,7 +16,6 @@ import argparse import iniparse import json -import logging import os import re import requests @@ -30,6 +29,7 @@ from keystoneclient.v2_0 import client as keystoneclient from neutronclient.v2_0 import client as neutronclient from cinderclient import client as cinderclient +import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as functest_utils import functest.utils.openstack_utils as openstack_utils @@ -74,19 +74,7 @@ else: RALLY_STDERR = open(os.devnull, 'w') """ logging configuration """ -logger = logging.getLogger("run_rally") -logger.setLevel(logging.DEBUG) - -ch = logging.StreamHandler() -if args.debug: - ch.setLevel(logging.DEBUG) -else: - ch.setLevel(logging.INFO) - -formatter = logging.Formatter("%(asctime)s - %(name)s - " - "%(levelname)s - %(message)s") -ch.setFormatter(formatter) -logger.addHandler(ch) +logger = ft_logger.Logger("run_rally").getLogger() REPO_PATH = os.environ['repos_dir'] + '/functest/' if not os.path.exists(REPO_PATH): diff --git a/testcases/VIM/OpenStack/CI/libraries/run_tempest.py b/testcases/VIM/OpenStack/CI/libraries/run_tempest.py index 68961d824..3afbbffa6 100644 --- a/testcases/VIM/OpenStack/CI/libraries/run_tempest.py +++ b/testcases/VIM/OpenStack/CI/libraries/run_tempest.py @@ -15,7 +15,6 @@ # import argparse import json -import logging import os import re import requests @@ -28,6 +27,7 @@ import ConfigParser import keystoneclient.v2_0.client as ksclient from neutronclient.v2_0 import client as neutronclient +import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as functest_utils import functest.utils.openstack_utils as openstack_utils @@ -56,19 +56,7 @@ parser.add_argument("-n", "--noclean", args = parser.parse_args() """ logging configuration """ -logger = logging.getLogger('run_tempest') -logger.setLevel(logging.DEBUG) - -ch = logging.StreamHandler() -if args.debug: - ch.setLevel(logging.DEBUG) -else: - ch.setLevel(logging.INFO) - -formatter = logging.Formatter('%(asctime)s - %(name)s - ' - '%(levelname)s - %(message)s') -ch.setFormatter(formatter) -logger.addHandler(ch) +logger = ft_logger.Logger("run_tempest").getLogger() REPO_PATH = os.environ['repos_dir'] + '/functest/' -- cgit 1.2.3-korg