X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=yardstick%2Fbenchmark%2Fscenarios%2Fcompute%2Flmbench.py;fp=yardstick%2Fbenchmark%2Fscenarios%2Fcompute%2Flmbench.py;h=6a17ae8a104137fec0a025aeee25b9f49ba1725e;hb=f036e9898a69f5041f9cde02e3652c29e2de1643;hp=518840c09cd820ecc133ff88f83729b68476d7c0;hpb=5f0b3d417244397b2d5e61c7a6ddd145f1d25046;p=yardstick.git diff --git a/yardstick/benchmark/scenarios/compute/lmbench.py b/yardstick/benchmark/scenarios/compute/lmbench.py index 518840c09..6a17ae8a1 100644 --- a/yardstick/benchmark/scenarios/compute/lmbench.py +++ b/yardstick/benchmark/scenarios/compute/lmbench.py @@ -6,9 +6,13 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -import pkg_resources +from __future__ import absolute_import +from __future__ import print_function + import logging -import json + +import pkg_resources +from oslo_serialization import jsonutils import yardstick.ssh as ssh from yardstick.benchmark.scenarios import base @@ -130,9 +134,10 @@ class Lmbench(base.Scenario): raise RuntimeError(stderr) if test_type == 'latency': - result.update({"latencies": json.loads(stdout)}) + result.update( + {"latencies": jsonutils.loads(stdout)}) else: - result.update(json.loads(stdout)) + result.update(jsonutils.loads(stdout)) if "sla" in self.scenario_cfg: sla_error = "" @@ -185,7 +190,8 @@ def _test(): p = Lmbench(args, ctx) p.run(result) - print result + print(result) + if __name__ == '__main__': _test()