summaryrefslogtreecommitdiffstats
path: root/utils/env_prepare
diff options
context:
space:
mode:
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):