X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=api%2Futils%2Fcommon.py;h=e3e64a72b7cfe4f973c715a141c71fc99565a929;hb=48a7b4fa8a9cfa2db8c002ffb68c46345551ee2a;hp=04a6fe0d6404da7d825aca2f17c08ecd568e482b;hpb=c0694a411eb2f3f6daa7271afce7e688beff805d;p=yardstick.git diff --git a/api/utils/common.py b/api/utils/common.py index 04a6fe0d6..e3e64a72b 100644 --- a/api/utils/common.py +++ b/api/utils/common.py @@ -8,7 +8,8 @@ ############################################################################## import collections import logging -import json + +from flask import jsonify from api.utils.daemonthread import DaemonThread from yardstick.cmd.cli import YardstickCLI @@ -34,7 +35,7 @@ def get_command_list(command_list, opts, args): task_args = opts.get('task-args', '') if task_args: - command_list.extend(['--task-args', task_args]) + command_list.extend(['--task-args', str(task_args)]) return command_list @@ -50,7 +51,7 @@ def error_handler(message): 'status': 'error', 'message': message } - return json.dumps(result) + return jsonify(result) def result_handler(status, data): @@ -58,7 +59,7 @@ def result_handler(status, data): 'status': status, 'result': data } - return json.dumps(result) + return jsonify(result) class Url(object):