aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/vPing/CI/libraries
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-04-27 16:28:55 +0200
committerJose Lausuch <jose.lausuch@ericsson.com>2016-04-27 15:09:38 +0000
commita2c96362067e32d569b8a02ca0ec022195e54b35 (patch)
tree43a9ae5642b290259024cf36ac7fed48a41a7277 /testcases/vPing/CI/libraries
parent9c13968cdb32806da738dc520d45270e019f0ad3 (diff)
Replace all the loggers by the functest logger module
JIRA: FUNCTEST-228 Change-Id: If7a3c8cb08e9fbdf155fc5eff5330f79e5f8d234 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'testcases/vPing/CI/libraries')
-rw-r--r--testcases/vPing/CI/libraries/vPing_ssh.py18
-rw-r--r--testcases/vPing/CI/libraries/vPing_userdata.py19
2 files changed, 4 insertions, 33 deletions
diff --git a/testcases/vPing/CI/libraries/vPing_ssh.py b/testcases/vPing/CI/libraries/vPing_ssh.py
index acf3065d..23b3d46f 100644
--- a/testcases/vPing/CI/libraries/vPing_ssh.py
+++ b/testcases/vPing/CI/libraries/vPing_ssh.py
@@ -15,7 +15,6 @@
#
import argparse
import datetime
-import logging
import os
import paramiko
import pprint
@@ -29,6 +28,7 @@ from neutronclient.v2_0 import client as neutronclient
from keystoneclient.v2_0 import client as keystoneclient
from glanceclient import client as glanceclient
+import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as functest_utils
import functest.utils.openstack_utils as openstack_utils
@@ -45,22 +45,8 @@ parser.add_argument("-r", "--report",
args = parser.parse_args()
""" logging configuration """
+logger = ft_logger.Logger("vping_ssh").getLogger()
-logger = logging.getLogger('vPing_ssh')
-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)
paramiko.util.log_to_file("/var/log/paramiko.log")
REPO_PATH = os.environ['repos_dir'] + '/functest/'
diff --git a/testcases/vPing/CI/libraries/vPing_userdata.py b/testcases/vPing/CI/libraries/vPing_userdata.py
index 862343c1..3e69ddfe 100644
--- a/testcases/vPing/CI/libraries/vPing_userdata.py
+++ b/testcases/vPing/CI/libraries/vPing_userdata.py
@@ -16,7 +16,6 @@
import argparse
import datetime
-import logging
import os
import pprint
import time
@@ -27,6 +26,7 @@ from neutronclient.v2_0 import client as neutronclient
from keystoneclient.v2_0 import client as keystoneclient
from glanceclient import client as glanceclient
+import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as functest_utils
import functest.utils.openstack_utils as openstack_utils
@@ -43,22 +43,7 @@ parser.add_argument("-r", "--report",
args = parser.parse_args()
""" logging configuration """
-
-logger = logging.getLogger('vPing_userdata')
-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("vping_userdata").getLogger()
REPO_PATH = os.environ['repos_dir'] + '/functest/'
if not os.path.exists(REPO_PATH):