roll back the bug-fix for source method
[bottlenecks.git] / utils / env_prepare / stack_prepare.py
index ce8da61..c1604f4 100644 (file)
@@ -32,9 +32,19 @@ def _prepare_env_daemon(test_yardstick):
     if not os.environ.get("EXTERNAL_NETWORK"):
         _append_external_network(rc_file)
     if test_yardstick:
+        yardstick_contain = docker_env.yardstick_info["container"]
         cmd = "cp %s %s" % (rc_file,
                             config.bottlenecks_config["yardstick_rc_dir"])
-        yardstick_contain = docker_env.yardstick_info["container"]
+        docker_env.docker_exec_cmd(yardstick_contain,
+                                   cmd)
+        file_orig = ("/home/opnfv/repos/yardstick/etc"
+                     "/yardstick/yardstick.conf.sample")
+        file_after = "/etc/yardstick/yardstick.conf"
+        cmd = "cp %s %s" % (file_orig,
+                            file_after)
+        docker_env.docker_exec_cmd(yardstick_contain,
+                                   cmd)
+        cmd = "sed -i '12s/http/file/g' /etc/yardstick/yardstick.conf"
         docker_env.docker_exec_cmd(yardstick_contain,
                                    cmd)
 
@@ -73,7 +83,8 @@ def _source_file(rc_file):
     p = subprocess.Popen(". %s; env" % rc_file, stdout=subprocess.PIPE,
                          shell=True)
     output = p.communicate()[0]
-    env = dict((line.split('=', 1) for line in output.splitlines()))
+    output_lines = output.splitlines()
+    env = dict((line.split('=', 1) for line in output_lines))
     os.environ.update(env)
     return env