X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Fdispatcher%2Fhttp.py;h=790086155fac3be5e7a46c4cd0fb18fbd1b1b996;hb=5babed1aa6b2f867e639193841b231c3a0200b87;hp=98e772dd820bfc40ff3a27989f54ed0bb1cd860f;hpb=827e341ed222a562a87d8f238fc0a6a16cfb1393;p=yardstick.git diff --git a/yardstick/dispatcher/http.py b/yardstick/dispatcher/http.py index 98e772dd8..790086155 100644 --- a/yardstick/dispatcher/http.py +++ b/yardstick/dispatcher/http.py @@ -16,11 +16,13 @@ # yardstick comment: this is a modified copy of # ceilometer/ceilometer/dispatcher/http.py -import os -import json +from __future__ import absolute_import + import logging -import requests +import os +from oslo_serialization import jsonutils +import requests from oslo_config import cfg from yardstick.dispatcher.base import Base as DispatchBase @@ -81,16 +83,18 @@ class HttpDispatcher(DispatchBase): case_name = v["scenario_cfg"]["tc"] break if case_name == "": - LOG.error('Test result : %s', json.dumps(self.result)) + LOG.error('Test result : %s', + jsonutils.dump_as_bytes(self.result)) LOG.error('The case_name cannot be found, no data will be posted.') return self.result["case_name"] = case_name try: - LOG.debug('Test result : %s', json.dumps(self.result)) + LOG.debug('Test result : %s', + jsonutils.dump_as_bytes(self.result)) res = requests.post(self.target, - data=json.dumps(self.result), + data=jsonutils.dump_as_bytes(self.result), headers=self.headers, timeout=self.timeout) LOG.debug('Test result posting finished with status code'