diff options
Diffstat (limited to 'deploy/post')
-rw-r--r-- | deploy/post/execute.py | 16 | ||||
-rw-r--r-- | deploy/post/keystoneauth.py | 4 |
2 files changed, 16 insertions, 4 deletions
diff --git a/deploy/post/execute.py b/deploy/post/execute.py index 6acbe637..7b0293a2 100644 --- a/deploy/post/execute.py +++ b/deploy/post/execute.py @@ -21,10 +21,20 @@ def _config_kolla_admin_openrc(kolla_config_path): with open('%s/globals.yml' % kolla_config_path, 'r') as f: kolla_config = yaml.safe_load(f.read()) if kolla_config.get('enable_opendaylight', None) == 'yes': - sdn_controller_ip = kolla_config.get('kolla_internal_vip_address') openrc_file = file('%s/admin-openrc.sh' % kolla_config_path, 'a') - sdn_ctl_ip = 'export SDN_CONTROLLER_IP=' + sdn_controller_ip + '\n' - openrc_file.write(sdn_ctl_ip) + + v = kolla_config.get('kolla_internal_vip_address') + line = 'export SDN_CONTROLLER_IP=' + v + '\n' + openrc_file.write(line) + + v = kolla_config.get('opendaylight_haproxy_restconf_port_backup') + line = 'export SDN_CONTROLLER_WEBPORT=' + v + '\n' + openrc_file.write(line) + + v = kolla_config.get('opendaylight_haproxy_restconf_port') + line = 'export SDN_CONTROLLER_RESTCONFPORT=' + v + '\n' + openrc_file.write(line) + openrc_file.close() diff --git a/deploy/post/keystoneauth.py b/deploy/post/keystoneauth.py index 2d7d0e75..f3d25ae0 100644 --- a/deploy/post/keystoneauth.py +++ b/deploy/post/keystoneauth.py @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 2017 ZTE Coreporation and others. +# Copyright (c) 2017 ZTE Corporation and others. # feng.xiaowei@zte.com.cn # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 @@ -30,6 +30,8 @@ class Keystoneauth(object): def _parse_openrc(self): def parse_line(creds, line): + if line.startswith('#') or "=" not in line: + return creds var = line.rstrip('"\n').replace('export ', '').split("=") # The two next lines should be modified as soon as rc_file # conforms with common rules. Be aware that it could induce |