From 56fbfa35104ff932297633ff33a80fd6dc832414 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Wed, 11 Jun 2014 09:10:54 +0000 Subject: [PATCH] Remove ovs plugin support as this is going to be baked into charm --- hooks/neutron-plugin-relation-broken | 1 - hooks/neutron-plugin-relation-changed | 1 - hooks/neutron-plugin-relation-departed | 1 - hooks/neutron-plugin-relation-joined | 1 - hooks/neutron_api_hooks.py | 17 +------------ hooks/neutron_api_utils.py | 33 ++++++++++++++++++-------- metadata.yaml | 3 --- templates/icehouse/ml2_conf.ini | 30 +++++++++++++++++++++++ templates/icehouse/neutron-server | 13 +--------- templates/icehouse/neutron.conf | 7 +----- 10 files changed, 56 insertions(+), 51 deletions(-) delete mode 120000 hooks/neutron-plugin-relation-broken delete mode 120000 hooks/neutron-plugin-relation-changed delete mode 120000 hooks/neutron-plugin-relation-departed delete mode 120000 hooks/neutron-plugin-relation-joined create mode 100644 templates/icehouse/ml2_conf.ini diff --git a/hooks/neutron-plugin-relation-broken b/hooks/neutron-plugin-relation-broken deleted file mode 120000 index 1fb10fd5..00000000 --- a/hooks/neutron-plugin-relation-broken +++ /dev/null @@ -1 +0,0 @@ -neutron_api_hooks.py \ No newline at end of file diff --git a/hooks/neutron-plugin-relation-changed b/hooks/neutron-plugin-relation-changed deleted file mode 120000 index 1fb10fd5..00000000 --- a/hooks/neutron-plugin-relation-changed +++ /dev/null @@ -1 +0,0 @@ -neutron_api_hooks.py \ No newline at end of file diff --git a/hooks/neutron-plugin-relation-departed b/hooks/neutron-plugin-relation-departed deleted file mode 120000 index 1fb10fd5..00000000 --- a/hooks/neutron-plugin-relation-departed +++ /dev/null @@ -1 +0,0 @@ -neutron_api_hooks.py \ No newline at end of file diff --git a/hooks/neutron-plugin-relation-joined b/hooks/neutron-plugin-relation-joined deleted file mode 120000 index 1fb10fd5..00000000 --- a/hooks/neutron-plugin-relation-joined +++ /dev/null @@ -1 +0,0 @@ -neutron_api_hooks.py \ No newline at end of file diff --git a/hooks/neutron_api_hooks.py b/hooks/neutron_api_hooks.py index 8d36a618..e408e8af 100755 --- a/hooks/neutron_api_hooks.py +++ b/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: diff --git a/hooks/neutron_api_utils.py b/hooks/neutron_api_utils.py index 19acf445..8b7b5d88 100644 --- a/hooks/neutron_api_utils.py +++ b/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(): diff --git a/metadata.yaml b/metadata.yaml index 0226bf4e..d4e0313b 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -17,6 +17,3 @@ requires: interface: rabbitmq identity-service: interface: keystone - neutron-plugin: - interface: neutron-plugin - scope: container diff --git a/templates/icehouse/ml2_conf.ini b/templates/icehouse/ml2_conf.ini new file mode 100644 index 00000000..cf5e10d0 --- /dev/null +++ b/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 -%} diff --git a/templates/icehouse/neutron-server b/templates/icehouse/neutron-server index abe76137..cbbc435c 100644 --- a/templates/icehouse/neutron-server +++ b/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 }}" \ No newline at end of file diff --git a/templates/icehouse/neutron.conf b/templates/icehouse/neutron.conf index 2a372769..2d4c4a02 100644 --- a/templates/icehouse/neutron.conf +++ b/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 \ No newline at end of file