Merge "Deprecate enable_tunneling in the OVS agent"
This commit is contained in:
commit
6ef206d25d
@ -26,6 +26,10 @@
|
||||
# for GRE or VXLAN networks. Requires kernel support for OVS patch ports and
|
||||
# GRE or VXLAN tunneling.
|
||||
#
|
||||
# WARNING: This option will be deprecated in the Icehouse release, and will
|
||||
# be replaced by specifying one or more 'tunnel_types' in the
|
||||
# "agent" section of the configuration file below.
|
||||
#
|
||||
# enable_tunneling = False
|
||||
|
||||
# (ListOpt) Comma-separated list of <tun_min>:<tun_max> tuples
|
||||
|
@ -810,6 +810,10 @@ def create_agent_config_map(config):
|
||||
tunnel_type=config.AGENT.tunnel_type,
|
||||
)
|
||||
|
||||
# If enable_tunneling is TRUE, set tunnel_type to default to GRE
|
||||
if config.OVS.enable_tunneling and not kwargs['tunnel_type']:
|
||||
kwargs['tunnel_type'] = constants.TYPE_GRE
|
||||
|
||||
if kwargs['tunnel_type'] in constants.TUNNEL_NETWORK_TYPES:
|
||||
if not kwargs['local_ip']:
|
||||
msg = _('Tunneling cannot be enabled without a valid local_ip.')
|
||||
|
@ -39,10 +39,26 @@ class CreateAgentConfigMap(base.BaseTestCase):
|
||||
self.assertTrue(ovs_quantum_agent.create_agent_config_map(cfg.CONF))
|
||||
|
||||
def test_create_agent_config_map_fails_for_invalid_tunnel_config(self):
|
||||
self.addCleanup(cfg.CONF.reset)
|
||||
# An ip address is required for tunneling but there is no default
|
||||
cfg.CONF.set_override('tunnel_type', constants.TYPE_GRE,
|
||||
group='AGENT')
|
||||
with testtools.ExpectedException(ValueError):
|
||||
ovs_quantum_agent.create_agent_config_map(cfg.CONF)
|
||||
|
||||
def test_create_agent_config_map_enable_tunneling(self):
|
||||
self.addCleanup(cfg.CONF.reset)
|
||||
# Verify setting only enable_tunneling will default tunnel_type to GRE
|
||||
cfg.CONF.set_override('tunnel_type', None, group='AGENT')
|
||||
cfg.CONF.set_override('enable_tunneling', True, group='OVS')
|
||||
cfg.CONF.set_override('local_ip', '10.10.10.10', group='OVS')
|
||||
cfgmap = ovs_quantum_agent.create_agent_config_map(cfg.CONF)
|
||||
self.assertEqual(cfgmap['tunnel_type'], constants.TYPE_GRE)
|
||||
|
||||
def test_create_agent_config_map_fails_no_local_ip(self):
|
||||
self.addCleanup(cfg.CONF.reset)
|
||||
# An ip address is required for tunneling but there is no default
|
||||
cfg.CONF.set_override('enable_tunneling', True, group='OVS')
|
||||
cfg.CONF.set_override('tunnel_type', 'gre', group='AGENT')
|
||||
with testtools.ExpectedException(ValueError):
|
||||
ovs_quantum_agent.create_agent_config_map(cfg.CONF)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user