From b73af5d9bba893ee846de5bd5315a0ff1a9033ce Mon Sep 17 00:00:00 2001 From: Zhou Ya Date: Thu, 28 Jul 2016 11:20:59 +0800 Subject: [PATCH] add openstack_version and docker_namespace choice in globals.yml Change-Id: If077b423f2a4d26e2ff070b3b8b1714cc6301993 Signed-off-by: Zhou Ya --- code/daisy/daisy/api/backends/kolla/config.py | 6 +++++- code/daisy/daisy/api/backends/kolla/install.py | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/code/daisy/daisy/api/backends/kolla/config.py b/code/daisy/daisy/api/backends/kolla/config.py index d5f04d82..3b7bab74 100755 --- a/code/daisy/daisy/api/backends/kolla/config.py +++ b/code/daisy/daisy/api/backends/kolla/config.py @@ -87,6 +87,8 @@ def add_role_to_inventory(file_path, config_data): # generate kolla's globals.yml file def update_globals_yml(config_data): + Version = config_data['Version'] + Namespace = config_data['Namespace'] VIP = config_data['VIP'] IntIfMac = config_data['IntIfMac'] ExtIfMac = config_data['ExtIfMac'] @@ -99,10 +101,12 @@ def update_globals_yml(config_data): 'network_interface': 'eth0', 'neutron_external_interface': 'eth1' } + kolla_yml['openstack_release'] = Version.encode() + kolla_yml['docker_registry'] = local_ip.encode() + kolla_yml['docker_namespace'] = Namespace.encode() kolla_yml['kolla_internal_vip_address'] = VIP.encode() kolla_yml['network_interface'] = IntIfMac.encode() kolla_yml['neutron_external_interface'] = ExtIfMac.encode() - kolla_yml['docker_registry'] = local_ip.encode() yaml.dump(kolla_yml, file('/etc/kolla/globals.yml', 'w'), default_flow_style=False) diff --git a/code/daisy/daisy/api/backends/kolla/install.py b/code/daisy/daisy/api/backends/kolla/install.py index f8544990..e3b79fcb 100755 --- a/code/daisy/daisy/api/backends/kolla/install.py +++ b/code/daisy/daisy/api/backends/kolla/install.py @@ -177,6 +177,8 @@ def get_cluster_kolla_config(req, cluster_id): computer_ip_list = [] mgt_macname_list = [] pub_macname_list = [] + openstack_version = '2.0.3' + docker_namespace = 'kolla' docker_registry_ip = _get_local_ip() docker_registry = docker_registry_ip + ':4000' cluster_networks = daisy_cmn.get_cluster_networks_detail(req, cluster_id) @@ -205,6 +207,8 @@ def get_cluster_kolla_config(req, cluster_id): management must be same!")) LOG.error(msg) raise HTTPForbidden(msg) + kolla_config.update({'Version': openstack_version}) + kolla_config.update({'Namespace': docker_namespace}) kolla_config.update({'VIP': kolla_vip}) kolla_config.update({'IntIfMac': mgt_macname}) kolla_config.update({'ExtIfMac': pub_macname})