Set empty NeutronTunnelTypes if tunneling is disabled
This patch causes NeutronTunnelTypes to '' if --neutron-disable-tunneling is specified on the command line. This reproduces the behavior previously implemented through the NeutronEnableTunnelling heat parameter. Change-Id: I6b8a4d08c63ae46fd5e6a86031f372b64e420a22 Closes-Bug: #1704400
This commit is contained in:
parent
153972c408
commit
a93e6d1a15
|
@ -928,6 +928,8 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||
# If this call does not raise an error, then call is validated
|
||||
self.cmd._validate_args(parsed_args)
|
||||
|
||||
self.assertEqual('', parsed_args.neutron_tunnel_types)
|
||||
|
||||
def test_validate_args_tunneling_disabled_with_tunnel_types(self):
|
||||
arglist = ['--templates',
|
||||
'--neutron-disable-tunneling',
|
||||
|
@ -940,8 +942,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
# If this call does not raise an error, then call is validated
|
||||
self.cmd._validate_args(parsed_args)
|
||||
self.assertRaises(oscexc.CommandError,
|
||||
self.cmd._validate_args,
|
||||
parsed_args)
|
||||
|
||||
def test_validate_args_vlan_as_network_type_no_vlan_range(self):
|
||||
arglist = ['--templates',
|
||||
|
|
|
@ -681,6 +681,16 @@ class DeployOvercloud(command.Command):
|
|||
network_type = parsed_args.neutron_network_type
|
||||
tunnel_types = parsed_args.neutron_tunnel_types
|
||||
tunnel_disabled = parsed_args.neutron_disable_tunneling
|
||||
|
||||
# We are no longer able to disable tunneling via a heat parameter
|
||||
# so the client must set an empty tunnel types value for
|
||||
# NeutronTunnelTypes to get the desired behavior.
|
||||
if tunnel_disabled:
|
||||
if tunnel_types:
|
||||
raise oscexc.CommandError("Cannot specify tunnel types when "
|
||||
"disabling tunneling")
|
||||
parsed_args.neutron_tunnel_types = ''
|
||||
|
||||
neutron_network_vlan_ranges = parsed_args.neutron_network_vlan_ranges
|
||||
if network_type == 'vlan' and not neutron_network_vlan_ranges:
|
||||
raise oscexc.CommandError(
|
||||
|
|
Loading…
Reference in New Issue