Merge "Removes check CONF.dhcp_options_enabled from nova"
This commit is contained in:
commit
3b32669390
|
@ -1286,9 +1286,6 @@
|
|||
# requests. (string value)
|
||||
#neutron_ca_certificates_file=<None>
|
||||
|
||||
# Use per-port DHCP options with Neutron (boolean value)
|
||||
#dhcp_options_enabled=false
|
||||
|
||||
|
||||
#
|
||||
# Options defined in nova.network.rpcapi
|
||||
|
|
|
@ -86,10 +86,7 @@ neutron_opts = [
|
|||
cfg.StrOpt('neutron_ca_certificates_file',
|
||||
help='Location of ca certificates file to use for '
|
||||
'neutron client requests.'),
|
||||
cfg.BoolOpt('dhcp_options_enabled',
|
||||
default=False,
|
||||
help='Use per-port DHCP options with Neutron'),
|
||||
]
|
||||
]
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(neutron_opts)
|
||||
|
@ -227,10 +224,7 @@ class API(base.Base):
|
|||
raise exception.InvalidInput(
|
||||
reason=msg % instance['display_name'])
|
||||
requested_networks = kwargs.get('requested_networks')
|
||||
# Note: (dkehn) this option check should be removed as soon as support
|
||||
# in neutron released, see https://bugs.launchpad.net/nova/+bug/1214162
|
||||
if CONF.dhcp_options_enabled:
|
||||
dhcp_opts = kwargs.get('dhcp_options', None)
|
||||
dhcp_opts = kwargs.get('dhcp_options', None)
|
||||
ports = {}
|
||||
fixed_ips = {}
|
||||
net_ids = []
|
||||
|
|
|
@ -274,12 +274,10 @@ class TestNeutronv2Base(test.TestCase):
|
|||
self.mox.StubOutWithMock(api, 'get_instance_nw_info')
|
||||
has_portbinding = False
|
||||
has_extra_dhcp_opts = False
|
||||
# Note: (dkehn) this option check should be removed as soon as support
|
||||
# in neutron released, see https://bugs.launchpad.net/nova/+bug/1214162
|
||||
if (cfg.CONF.dhcp_options_enabled == True and kwargs.get(
|
||||
'dhcp_options', None) != None):
|
||||
dhcp_options = kwargs.get('dhcp_options')
|
||||
if dhcp_options is not None:
|
||||
has_extra_dhcp_opts = True
|
||||
dhcp_options = kwargs.get('dhcp_options')
|
||||
|
||||
if kwargs.get('portbinding'):
|
||||
has_portbinding = True
|
||||
api.extensions[constants.PORTBINDING_EXT] = 1
|
||||
|
@ -1810,16 +1808,9 @@ class TestNeutronv2ExtraDhcpOpts(TestNeutronv2Base):
|
|||
self.moxed_client)
|
||||
|
||||
def test_allocate_for_instance_1_with_extra_dhcp_opts_turned_off(self):
|
||||
# Note: (dkehn) this option check should be removed as soon as support
|
||||
# in neutron released, see https://bugs.launchpad.net/nova/+bug/1214162
|
||||
CONF.set_override('dhcp_options_enabled', True)
|
||||
self._allocate_for_instance(1, extra_dhcp_opts=False)
|
||||
CONF.set_override('dhcp_options_enabled', False)
|
||||
|
||||
def test_allocate_for_instance_extradhcpopts(self):
|
||||
# Note: (dkehn) this option check should be removed as soon as support
|
||||
# in neutron released, see https://bugs.launchpad.net/nova/+bug/1214162
|
||||
CONF.set_override('dhcp_options_enabled', True)
|
||||
dhcp_opts = [{'opt_name': 'bootfile-name',
|
||||
'opt_value': 'pxelinux.0'},
|
||||
{'opt_name': 'tftp-server',
|
||||
|
@ -1828,7 +1819,6 @@ class TestNeutronv2ExtraDhcpOpts(TestNeutronv2Base):
|
|||
'opt_value': '123.123.123.456'}]
|
||||
|
||||
self._allocate_for_instance(1, dhcp_options=dhcp_opts)
|
||||
CONF.set_override('dhcp_options_enabled', False)
|
||||
|
||||
|
||||
class TestNeutronClientForAdminScenarios(test.TestCase):
|
||||
|
|
Loading…
Reference in New Issue