Add support for Python 3
[yardstick.git] / yardstick / benchmark / scenarios / compute / cyclictest.py
index 568e6e7..76bafff 100644 (file)
@@ -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
@@ -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 = ""
@@ -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()