diff options
Diffstat (limited to 'api/utils/common.py')
-rw-r--r-- | api/utils/common.py | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/api/utils/common.py b/api/utils/common.py index f8b0d40ba..eda9c17dd 100644 --- a/api/utils/common.py +++ b/api/utils/common.py @@ -13,10 +13,8 @@ import logging from flask import jsonify import six -from api.utils.daemonthread import DaemonThread -from yardstick.cmd.cli import YardstickCLI - -logger = logging.getLogger(__name__) +LOG = logging.getLogger(__name__) +LOG.setLevel(logging.DEBUG) def translate_to_str(obj): @@ -29,33 +27,6 @@ def translate_to_str(obj): return obj -def get_command_list(command_list, opts, args): - - command_list.append(args) - - command_list.extend(('--{}'.format(k) for k in opts if k != 'task-args')) - - task_args = opts.get('task-args', '') - if task_args: - command_list.extend(['--task-args', str(task_args)]) - - return command_list - - -def exec_command_task(command_list, task_dict): # pragma: no cover - daemonthread = DaemonThread(YardstickCLI().api, (command_list, task_dict)) - daemonthread.start() - - -def error_handler(message): - logger.debug(message) - result = { - 'status': 'error', - 'message': message - } - return jsonify(result) - - def result_handler(status, data): result = { 'status': status, |