Merge "Bux: task_id parameter from API can not pass to yardstick core"
[yardstick.git] / yardstick / benchmark / scenarios / networking / networkcapacity.py
index 438452e..e7ce835 100644 (file)
@@ -6,9 +6,12 @@
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
-import pkg_resources
+from __future__ import absolute_import
+
 import logging
-import json
+
+import pkg_resources
+from oslo_serialization import jsonutils
 
 import yardstick.ssh as ssh
 from yardstick.benchmark.scenarios import base
@@ -50,8 +53,7 @@ class NetworkCapacity(base.Scenario):
         self.client.wait(timeout=600)
 
         # copy script to host
-        self.client.run("cat > ~/networkcapacity.sh",
-                        stdin=open(self.target_script, 'rb'))
+        self.client._put_file_shell(self.target_script, '~/networkcapacity.sh')
 
         self.setup_done = True
 
@@ -68,4 +70,4 @@ class NetworkCapacity(base.Scenario):
         if status:
             raise RuntimeError(stderr)
 
-        result.update(json.loads(stdout))
+        result.update(jsonutils.loads(stdout))