Write neutron-server default via context

This commit is contained in:
James Page
2013-10-16 12:54:16 +01:00
parent 0eaeba3fe6
commit 975bfe5a0e
4 changed files with 28 additions and 6 deletions

View File

@@ -385,12 +385,14 @@ class NeutronContext(object):
def ovs_ctxt(self):
driver = neutron_plugin_attribute(self.plugin, 'driver',
self.network_manager)
config = neutron_plugin_attribute(self.plugin, 'config',
self.network_manager)
ovs_ctxt = {
'core_plugin': driver,
'neutron_plugin': 'ovs',
'neutron_security_groups': self.neutron_security_groups,
'local_ip': unit_private_ip(),
'config': config
}
return ovs_ctxt
@@ -398,12 +400,14 @@ class NeutronContext(object):
def nvp_ctxt(self):
driver = neutron_plugin_attribute(self.plugin, 'driver',
self.network_manager)
config = neutron_plugin_attribute(self.plugin, 'config',
self.network_manager)
nvp_ctxt = {
'core_plugin': driver,
'neutron_plugin': 'nvp',
'neutron_security_groups': self.neutron_security_groups,
'local_ip': unit_private_ip(),
'config': config
}
return nvp_ctxt

View File

@@ -76,6 +76,8 @@ NEUTRON_CONF = '/etc/neutron/neutron.conf'
HAPROXY_CONF = '/etc/haproxy/haproxy.cfg'
APACHE_CONF = '/etc/apache2/sites-available/openstack_https_frontend'
APACHE_24_CONF = '/etc/apache2/sites-available/openstack_https_frontend.conf'
NEUTRON_DEFAULT = '/etc/default/neutron-server'
QUANTUM_DEFAULT = '/etc/default/quantum-server'
BASE_RESOURCE_MAP = OrderedDict([
(NOVA_CONF, {
@@ -100,6 +102,10 @@ BASE_RESOURCE_MAP = OrderedDict([
nova_cc_context.IdentityServiceContext(),
nova_cc_context.NeutronCCContext()],
}),
(QUANTUM_DEFAULT, {
'services': ['quantum-server'],
'contexts': [nova_cc_context.NeutronCCContext()],
}),
(QUANTUM_API_PASTE, {
'services': ['quantum-server'],
'contexts': [nova_cc_context.IdentityServiceContext()],
@@ -111,6 +117,10 @@ BASE_RESOURCE_MAP = OrderedDict([
nova_cc_context.NeutronCCContext(),
nova_cc_context.HAProxyContext()],
}),
(NEUTRON_DEFAULT, {
'services': ['neutron-server'],
'contexts': [nova_cc_context.NeutronCCContext()],
}),
(HAPROXY_CONF, {
'contexts': [context.HAProxyContext(),
nova_cc_context.HAProxyContext()],
@@ -175,10 +185,6 @@ def resource_map():
resource_map[conf]['contexts'] = ctxts
resource_map[conf]['contexts'].append(
nova_cc_context.NeutronCCContext())
# TODO: make a proper context - this is a bit ugly
with open('/etc/default/{}-server'.format(net_manager), 'w') as f:
f.write('{}_PLUGIN_CONFIG="{}"'.format(net_manager.upper(),
conf))
# nova-conductor for releases >= G.
if os_release('nova-common') not in ['essex', 'folsom']:

View File

@@ -0,0 +1,6 @@
# quantum
###############################################################################
# [ WARNING ]
# Configuration file maintained by Juju. Local changes may be overwritten.
###############################################################################
QUANTUM_PLUGIN_CONFIG="{{ config }}"

View File

@@ -0,0 +1,6 @@
# havana
###############################################################################
# [ WARNING ]
# Configuration file maintained by Juju. Local changes may be overwritten.
###############################################################################
NEUTRON_PLUGIN_CONFIG="{{ config }}"