diff options
author | 2017-03-16 11:02:22 +0800 | |
---|---|---|
committer | 2017-03-16 11:02:22 +0800 | |
commit | f2732403ec17a9ad9d301cc45771a382f919a68e (patch) | |
tree | e33713d9f0def4605a6905305f2b0450a5eb6f9a /deploy/prepare/execute.py | |
parent | 14e004572090b06067ac599afb88a6bf12f63389 (diff) |
refactor set default_floating_pool
Change-Id: I2e59f1ea7abdfc2bbd1f89cb19d55dd4eb053112
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'deploy/prepare/execute.py')
-rw-r--r-- | deploy/prepare/execute.py | 24 |
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() |