Support for neutron_url in nova.conf
This commit is contained in:
commit
6819375450
@ -410,6 +410,22 @@ class NeutronContext(object):
|
||||
|
||||
return nvp_ctxt
|
||||
|
||||
def neutron_ctxt(self):
|
||||
if https():
|
||||
proto = 'https'
|
||||
else:
|
||||
proto = 'http'
|
||||
if is_clustered():
|
||||
host = config()['vip']
|
||||
else:
|
||||
host = unit_get('private-address')
|
||||
url = proto + '://' + host + ':9696'
|
||||
ctxt = {
|
||||
'network_manager': self.network_manager,
|
||||
'neutron_url': url,
|
||||
}
|
||||
return ctxt
|
||||
|
||||
def __call__(self):
|
||||
self._ensure_packages()
|
||||
|
||||
@ -419,7 +435,7 @@ class NeutronContext(object):
|
||||
if not self.plugin:
|
||||
return {}
|
||||
|
||||
ctxt = {'network_manager': self.network_manager}
|
||||
ctxt = self.neutron_ctxt()
|
||||
|
||||
if self.plugin == 'ovs':
|
||||
ctxt.update(self.ovs_ctxt())
|
||||
|
@ -73,6 +73,7 @@ default_floating_pool = {{ external_network }}
|
||||
|
||||
{% if network_manager and network_manager == 'quantum' -%}
|
||||
network_api_class = nova.network.quantumv2.api.API
|
||||
quantum_url = {{ neutron_url }}
|
||||
{% if auth_host -%}
|
||||
quantum_auth_strategy = keystone
|
||||
quantum_admin_tenant_name = {{ admin_tenant_name }}
|
||||
@ -82,6 +83,7 @@ quantum_admin_auth_url = {{ auth_protocol }}://{{ auth_host }}:{{ auth_port }}/v
|
||||
{% endif -%}
|
||||
{% elif network_manager and network_manager == 'neutron' -%}
|
||||
network_api_class = nova.network.neutronv2.api.API
|
||||
neutron_url = {{ neutron_url }}
|
||||
{% if auth_host -%}
|
||||
neutron_auth_strategy = keystone
|
||||
neutron_admin_tenant_name = {{ admin_tenant_name }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user