diff --git a/config.yaml b/config.yaml index bff19a67..0e182d52 100644 --- a/config.yaml +++ b/config.yaml @@ -334,3 +334,9 @@ options: Can be used to avoid excessive memory consumption. WARNING: Should be NOT LESS than 25. (Available from Stein) + ovsdb-timeout: + type: int + default: + description: | + Timeout in seconds for ovsdb commands. + (Available from Queens) diff --git a/hooks/neutron_contexts.py b/hooks/neutron_contexts.py index df698830..b963cb19 100644 --- a/hooks/neutron_contexts.py +++ b/hooks/neutron_contexts.py @@ -180,6 +180,7 @@ class NeutronGatewayContext(NeutronAPIContext): 'enable_isolated_metadata': config('enable-isolated-metadata'), 'availability_zone': get_availability_zone(), 'enable_nfg_logging': api_settings['enable_nfg_logging'], + 'ovsdb_timeout': config('ovsdb-timeout'), } ctxt['local_ip'] = get_local_ip() diff --git a/templates/queens/openvswitch_agent.ini b/templates/queens/openvswitch_agent.ini new file mode 100644 index 00000000..347e7bb3 --- /dev/null +++ b/templates/queens/openvswitch_agent.ini @@ -0,0 +1,26 @@ +# queens +############################################################################### +# [ WARNING ] +# Configuration file maintained by Juju. Local changes may be overwritten. +############################################################################### +[ovs] +enable_tunneling = True +local_ip = {{ local_ip }} +bridge_mappings = {{ bridge_mappings }} +{%- if ovsdb_timeout and ovsdb_timeout > 0 %} +ovsdb_timeout = {{ovsdb_timeout}} +{%- endif %} + +[agent] +tunnel_types = {{ overlay_network_type }} +l2_population = {{ l2_population }} +enable_distributed_routing = {{ enable_dvr }} +{% if veth_mtu -%} +veth_mtu = {{ veth_mtu }} +{% endif -%} +{% if extension_drivers -%} +extensions = {{ extension_drivers }} +{% endif %} + +[securitygroup] +firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver diff --git a/unit_tests/test_neutron_contexts.py b/unit_tests/test_neutron_contexts.py index 90b8c5ea..db3c35fe 100644 --- a/unit_tests/test_neutron_contexts.py +++ b/unit_tests/test_neutron_contexts.py @@ -202,6 +202,8 @@ class TestNeutronGatewayContext(CharmTestCase): self.test_config.set('customize-failure-domain', False) self.test_config.set('default-availability-zone', 'nova') + self.test_config.set('ovsdb-timeout', 10) + self.network_get_primary_address.side_effect = NotImplementedError self.unit_get.return_value = '10.5.0.1' # Provided by neutron-api relation @@ -243,6 +245,7 @@ class TestNeutronGatewayContext(CharmTestCase): 'nfg_log_burst_limit': 50, 'nfg_log_output_base': '/var/log/firewall-logs', 'nfg_log_rate_limit': 100, + 'ovsdb_timeout': 10, }) @patch.object(neutron_contexts, 'validate_nfg_log_path', lambda x: x) @@ -270,6 +273,7 @@ class TestNeutronGatewayContext(CharmTestCase): self.test_config.set('customize-failure-domain', False) self.test_config.set('default-availability-zone', 'nova') + self.test_config.set('ovsdb-timeout', 60) self.network_get_primary_address.return_value = '192.168.20.2' self.unit_get.return_value = '10.5.0.1' @@ -312,6 +316,7 @@ class TestNeutronGatewayContext(CharmTestCase): 'nfg_log_burst_limit': 25, 'nfg_log_output_base': None, 'nfg_log_rate_limit': None, + 'ovsdb_timeout': 60, }) @patch('charmhelpers.contrib.openstack.context.relation_get')