summaryrefslogtreecommitdiffstats
path: root/utils/env_prepare
diff options
context:
space:
mode:
authorliyin <liyin11@huawei.com>2017-07-13 11:54:08 +0800
committerYu Yang (Gabriel) <Gabriel.yuyang@huawei.com>2017-07-18 01:33:06 +0000
commit1fd4046eacef68412f65ac888646c14999fa8236 (patch)
tree603541c646b304c653f50e1f412520754d9bab62 /utils/env_prepare
parent45d371c2a2d89231db9ffa892ce19da8f8b3cfa4 (diff)
Add frame support of elk one docker support
JIRA: BOTTLENECK-171 Add support of Bottlenecks docker frame refact, After this patch we will provide the ability of several installer. Add Yardstick_TAG to adjust yardstick docker version Change-Id: Ib431f8acf4a76b59f9d5e8783bcc7d2e5be208ae Signed-off-by: liyin <liyin11@huawei.com> (cherry picked from commit bde702f95563cf953c32f9bfd0587083a3fea26d)
Diffstat (limited to 'utils/env_prepare')
-rw-r--r--utils/env_prepare/quota_prepare.py3
-rw-r--r--utils/env_prepare/stack_prepare.py30
2 files changed, 25 insertions, 8 deletions
diff --git a/utils/env_prepare/quota_prepare.py b/utils/env_prepare/quota_prepare.py
index e52a3e32..850a46a4 100644
--- a/utils/env_prepare/quota_prepare.py
+++ b/utils/env_prepare/quota_prepare.py
@@ -21,7 +21,8 @@ neutron_quota = {"subnet": -1,
"floatingip": -1,
"subnetpool": -1,
"router": -1,
- "port": -1}
+ "port": -1,
+ "security_group": -1}
nova_quota = {"ram": -1,
"cores": -1,
diff --git a/utils/env_prepare/stack_prepare.py b/utils/env_prepare/stack_prepare.py
index 3c706fad..ce8da619 100644
--- a/utils/env_prepare/stack_prepare.py
+++ b/utils/env_prepare/stack_prepare.py
@@ -13,25 +13,41 @@ import errno
from utils.logger import Logger
from utils.parser import Parser as config
import utils.infra_setup.heat.manager as utils
+import utils.infra_setup.runner.docker_env as docker_env
LOG = Logger(__name__).getLogger()
-def _prepare_env_daemon():
-
- installer_ip = os.environ.get('INSTALLER_IP', 'undefined')
- installer_type = os.environ.get('INSTALLER_TYPE', 'undefined')
+def _prepare_env_daemon(test_yardstick):
rc_file = config.bottlenecks_config["rc_dir"]
- _get_remote_rc_file(rc_file, installer_ip, installer_type)
+ if not os.path.exists(rc_file):
+ installer_ip = os.environ.get('INSTALLER_IP', 'undefined')
+ installer_type = os.environ.get('INSTALLER_TYPE', 'undefined')
+ _get_remote_rc_file(rc_file, installer_ip, installer_type)
_source_file(rc_file)
- # _append_external_network(rc_file)
+ if not os.environ.get("EXTERNAL_NETWORK"):
+ _append_external_network(rc_file)
+ if test_yardstick:
+ 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)
# update the external_network
- # _source_file(rc_file)
+ _source_file(rc_file)
+
+
+def file_copy(src_file, dest_file):
+ src = file(src_file, "r+")
+ des = file(dest_file, "w+")
+ des.writelines(src.read())
+ src.close()
+ des.close()
def _get_remote_rc_file(rc_file, installer_ip, installer_type):