aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/VIM/OpenStack
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/VIM/OpenStack
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/VIM/OpenStack')
-rwxr-xr-xtestcases/VIM/OpenStack/CI/libraries/run_rally-cert.py16
-rw-r--r--testcases/VIM/OpenStack/CI/libraries/run_tempest.py16
2 files changed, 4 insertions, 28 deletions
diff --git a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py
index 6c753b02..4acc432b 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 68961d82..3afbbffa 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/'
s="cm"> * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifdef CONFIG_DEBUG_FS #define HID_DEBUG_BUFSIZE 512 void hid_dump_input(struct hid_device *, struct hid_usage *, __s32); void hid_dump_report(struct hid_device *, int , u8 *, int); void hid_dump_device(struct hid_device *, struct seq_file *); void hid_dump_field(struct hid_field *, int, struct seq_file *); char *hid_resolv_usage(unsigned, struct seq_file *); void hid_debug_register(struct hid_device *, const char *); void hid_debug_unregister(struct hid_device *); void hid_debug_init(void); void hid_debug_exit(void); void hid_debug_event(struct hid_device *, char *); struct hid_debug_list { char *hid_debug_buf; int head; int tail; struct fasync_struct *fasync; struct hid_device *hdev; struct list_head node; struct mutex read_mutex; }; #else #define hid_dump_input(a,b,c) do { } while (0) #define hid_dump_report(a,b,c,d) do { } while (0) #define hid_dump_device(a,b) do { } while (0) #define hid_dump_field(a,b,c) do { } while (0) #define hid_resolv_usage(a,b) do { } while (0) #define hid_debug_register(a, b) do { } while (0) #define hid_debug_unregister(a) do { } while (0) #define hid_debug_init() do { } while (0) #define hid_debug_exit() do { } while (0) #define hid_debug_event(a,b) do { } while (0) #endif #endif