summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhijiang Hu <hu.zhijiang@zte.com.cn>2017-03-16 07:36:13 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-03-16 07:36:13 +0000
commitfd49859523e1914bece099b326ea723068e33262 (patch)
tree8d7d120b4c8d8e0bed8c014ddd0292114af3b577
parentf5573291d9a133cfd599bd366806466c4ce1ea98 (diff)
parentf2732403ec17a9ad9d301cc45771a382f919a68e (diff)
Merge "refactor set default_floating_pool"
-rw-r--r--deploy/prepare/execute.py24
1 files changed, 8 insertions, 16 deletions
diff --git a/deploy/prepare/execute.py b/deploy/prepare/execute.py
index 0a54a4eb..c59d10ae 100644
--- a/deploy/prepare/execute.py
+++ b/deploy/prepare/execute.py
@@ -17,21 +17,6 @@ def _write_conf_file(conf_file, conf):
f.close()
-def _config(service, sub_server, conf):
- service_conf_path = os.path.join(KOLLA_CONF_PATH, service)
- sub_service_conf = os.path.join(service_conf_path,
- '{}-{}.conf'.format(service, sub_server))
- _make_dirs(service_conf_path)
- _write_conf_file(sub_service_conf, conf)
-
-
-def _config_nova_api(network_file):
- xnet = NetworkConfig(network_file=network_file).external_network
- _config('nova', 'api',
- '[DEFAULT]\n'
- 'default_floating_pool = {}\n'.format(xnet['network_name']))
-
-
def _config_service(service, subs):
def _wrap(func):
def _config(*args):
@@ -45,6 +30,13 @@ def _config_service(service, subs):
return _wrap
+@_config_service('nova', ['api'])
+def _set_default_floating_pool(network_file):
+ xnet = NetworkConfig(network_file=network_file).external_network
+ return '[DEFAULT]\n' \
+ 'default_floating_pool = {}\n'.format(xnet['network_name'])
+
+
@_config_service('heat', ['api', 'engine'])
def _set_trusts_auth():
return '[DEFAULT]\n' \
@@ -59,7 +51,7 @@ def main():
required=True,
help='network configuration file')
args = parser.parse_args()
- _config_nova_api(args.network_file)
+ _set_default_floating_pool(args.network_file)
_set_trusts_auth()