summaryrefslogtreecommitdiffstats
path: root/func/driver.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2016-09-20 13:58:21 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2016-09-21 15:02:44 +0800
commit6183cefebbc1af8ad1987dc61372d6c2d6a59f6d (patch)
treed2300ba196eb5e61fd2366a44e29f018791ad961 /func/driver.py
parentfac2a3bff97efed6d4e50bfe249c8107100b8f52 (diff)
add unified logger process for qtip
log the output information to both file and console, and unify the log file path and level JIRA: QTIP-108 Change-Id: I3a881e9da1f74c6959250a94f05cf90a231c34e6 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'func/driver.py')
-rw-r--r--func/driver.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/func/driver.py b/func/driver.py
index 726016a5..ff40a4cc 100644
--- a/func/driver.py
+++ b/func/driver.py
@@ -1,20 +1,22 @@
##############################################################################
-# Copyright (c) 2015 Dell Inc and others.
+# Copyright (c) 2015 Dell Inc, ZTE and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-import logging
-from func.ansible_api import AnsibleApi
+from utils import logger_utils
+from ansible_api import AnsibleApi
+
+logger = logger_utils.QtipLogger('driver').get
class Driver:
def __init__(self):
- logging.info("Class driver initialized\n")
+ logger.info("Class driver initialized\n")
self.installer_username = {'fuel': 'root',
'joid': 'ubuntu',
'apex': 'heat-admin'}
@@ -58,7 +60,7 @@ class Driver:
return special_json
def run_ansible_playbook(self, benchmark, extra_vars):
- logging.info(extra_vars)
+ logger.info(extra_vars)
ansible_api = AnsibleApi()
ansible_api.execute_playbook('./data/hosts',
'./benchmarks/playbooks/{0}.yaml'.format(benchmark),