X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Fbenchmark%2Fscenarios%2Fcompute%2Fcyclictest.py;h=ae1d373246406b4b1bdc3ecc9249f165754850ac;hb=5ecd7b446156775b8adb9cd15fe7decea5d305d9;hp=568e6e7dfe90d848cd9bc089a3b823f09d311ff7;hpb=74479a22c461cc2c08f9525879481c0a86d3af84;p=yardstick.git diff --git a/yardstick/benchmark/scenarios/compute/cyclictest.py b/yardstick/benchmark/scenarios/compute/cyclictest.py index 568e6e7df..ae1d37324 100644 --- a/yardstick/benchmark/scenarios/compute/cyclictest.py +++ b/yardstick/benchmark/scenarios/compute/cyclictest.py @@ -6,12 +6,16 @@ # 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 os import re import time -import os + +import pkg_resources +from oslo_serialization import jsonutils import yardstick.ssh as ssh from yardstick.benchmark.scenarios import base @@ -137,7 +141,7 @@ class Cyclictest(base.Scenario): self._connect_guest() def setup(self): - '''scenario setup''' + """scenario setup""" setup_options = self.scenario_cfg["setup_options"] host_setup_seqs = setup_options["host_setup_seqs"] guest_setup_seqs = setup_options["guest_setup_seqs"] @@ -183,7 +187,7 @@ class Cyclictest(base.Scenario): if status: raise RuntimeError(stderr) - result.update(json.loads(stdout)) + result.update(jsonutils.loads(stdout)) if "sla" in self.scenario_cfg: sla_error = "" @@ -201,7 +205,7 @@ class Cyclictest(base.Scenario): def _test(): # pragma: no cover - '''internal test function''' + """internal test function""" key_filename = pkg_resources.resource_filename("yardstick.resources", "files/yardstick_key") ctx = { @@ -236,7 +240,8 @@ def _test(): # pragma: no cover cyclictest = Cyclictest(args, ctx) cyclictest.run(result) - print result + print(result) + if __name__ == '__main__': # pragma: no cover _test()