Browse Source

Remove ovs plugin support as this is going to be baked into charm

changes/98/286798/1
Liam Young 8 years ago
parent
commit
56fbfa3510
  1. 1
      hooks/neutron-plugin-relation-broken
  2. 1
      hooks/neutron-plugin-relation-changed
  3. 1
      hooks/neutron-plugin-relation-departed
  4. 1
      hooks/neutron-plugin-relation-joined
  5. 17
      hooks/neutron_api_hooks.py
  6. 33
      hooks/neutron_api_utils.py
  7. 3
      metadata.yaml
  8. 30
      templates/icehouse/ml2_conf.ini
  9. 13
      templates/icehouse/neutron-server
  10. 7
      templates/icehouse/neutron.conf

1
hooks/neutron-plugin-relation-broken

@ -1 +0,0 @@
neutron_api_hooks.py

1
hooks/neutron-plugin-relation-changed

@ -1 +0,0 @@
neutron_api_hooks.py

1
hooks/neutron-plugin-relation-departed

@ -1 +0,0 @@
neutron_api_hooks.py

1
hooks/neutron-plugin-relation-joined

@ -1 +0,0 @@
neutron_api_hooks.py

17
hooks/neutron_api_hooks.py

@ -1,7 +1,6 @@
#!/usr/bin/python
import sys
import uuid
from charmhelpers.core.hookenv import (
Hooks,
@ -69,7 +68,6 @@ def install():
@hooks.hook('config-changed')
@restart_on_change(restart_map(), stopstart=True)
def config_changed():
# XXX Changing rabbit-user leaves password broken
global CONFIGS
CONFIGS.write_all()
@ -233,20 +231,7 @@ def neutron_api_relation_joined(rid=None):
@hooks.hook('neutron-api-relation-changed')
@restart_on_change(restart_map())
def neutron_api_relation_changed():
CONFIGS.write_all()
@hooks.hook('neutron-plugin-relation-joined')
def neutron_plugin_relation_joined(rid=None, remote_restart=False):
rel_settings = {}
rel_settings['neutron_security_groups'] = config('neutron-security-groups')
if remote_restart:
rel_settings['restart_trigger'] = str(uuid.uuid4())
relation_set(relation_id=rid, **rel_settings)
@hooks.hook('neutron-plugin-relation-changed')
@restart_on_change(restart_map())
def neutron_plugin_relation_changed():
CONFIGS.write_all()
CONFIGS.write(NEUTRON_CONF)
def main():
try:

33
hooks/neutron_api_utils.py

@ -57,18 +57,11 @@ BASE_RESOURCE_MAP = OrderedDict([
neutron_api_context.NeutronPostgresqlDBContext(),
neutron_api_context.IdentityServiceContext(),
neutron_api_context.NeutronCCContext(),
context.SyslogContext(),
context.SubordinateConfigContext(
interface='neutron-plugin',
service='neutron',
config_file=NEUTRON_CONF)],
context.SyslogContext()],
}),
(NEUTRON_DEFAULT, {
'services': ['neutron-server'],
'contexts': [context.SubordinateConfigContext(
interface='neutron-plugin',
service='neutron',
config_file=NEUTRON_DEFAULT)],
'contexts': [neutron_api_context.NeutronCCContext()],
}),
])
def api_port(service):
@ -122,11 +115,31 @@ def resource_map():
'''
resource_map = deepcopy(BASE_RESOURCE_MAP)
net_manager = network_manager()
# add neutron plugin requirements. nova-c-c only needs the neutron-server
# associated with configs, not the plugin agent.
plugin = config('neutron-plugin')
conf = neutron_plugin_attribute(plugin, 'config', net_manager)
ctxts = (neutron_plugin_attribute(plugin, 'contexts', net_manager)
or [])
services = neutron_plugin_attribute(plugin, 'server_services',
net_manager)
resource_map[conf] = {}
resource_map[conf]['services'] = services
resource_map[conf]['contexts'] = ctxts
resource_map[conf]['contexts'].append(
neutron_api_context.NeutronCCContext())
# update for postgres
resource_map[conf]['contexts'].append(
neutron_api_context.NeutronPostgresqlDBContext())
return resource_map
def register_configs(release=None):
release = release or os_release('neutron-common')
release = release or os_release('nova-common')
configs = templating.OSConfigRenderer(templates_dir=TEMPLATES,
openstack_release=release)
for cfg, rscs in resource_map().iteritems():

3
metadata.yaml

@ -17,6 +17,3 @@ requires:
interface: rabbitmq
identity-service:
interface: keystone
neutron-plugin:
interface: neutron-plugin
scope: container

30
templates/icehouse/ml2_conf.ini

@ -0,0 +1,30 @@
# icehouse
###############################################################################
# [ WARNING ]
# Configuration file maintained by Juju. Local changes may be overwritten.
###############################################################################
[ml2]
type_drivers = gre,vxlan
tenant_network_types = gre,vxlan
mechanism_drivers = openvswitch
[ml2_type_gre]
tunnel_id_ranges = 1:1000
[ml2_type_vxlan]
vni_ranges = 1001:2000
[ovs]
enable_tunneling = True
local_ip = {{ local_ip }}
[agent]
tunnel_types = gre
[securitygroup]
{% if neutron_security_groups -%}
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
{% else -%}
enable_security_group = False
{% endif -%}

13
templates/icehouse/neutron-server

@ -2,16 +2,5 @@
###############################################################################
# [ WARNING ]
# Configuration file maintained by Juju. Local changes may be overwritten.
{% if sections and 'COMMENT' in sections -%}
{% for key, value in sections['COMMENT'] -%}
# {{ value }}
{% endfor -%}
{% endif -%}
###############################################################################
{% if sections and 'DEFAULT' in sections -%}
{% for key, value in sections['DEFAULT'] -%}
{{ key }}="{{ value }}"
{% endfor -%}
{% else -%}
NEUTRON_PLUGIN_CONFIG=""
{% endif -%}
NEUTRON_PLUGIN_CONFIG="{{ config }}"

7
templates/icehouse/neutron.conf

@ -1,11 +1,6 @@
###############################################################################
# [ WARNING ]
# Configuration file maintained by Juju. Local changes may be overwritten.
{% if sections and 'COMMENT' in sections -%}
{% for key, value in sections['COMMENT'] -%}
# {{ value }}
{% endfor -%}
{% endif -%}
###############################################################################
[DEFAULT]
state_path = /var/lib/neutron
@ -73,4 +68,4 @@ admin_password = {{ admin_password }}
[service_providers]
service_provider=LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
service_provider=VPN:openswan:neutron.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default
service_provider=FIREWALL:Iptables:neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver:default
service_provider=FIREWALL:Iptables:neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver:default
Loading…
Cancel
Save