Skip to content

Commit 3292103

Browse files
author
Rohan Kanade
committed
Removes check CONF.dhcp_options_enabled from nova
* Neutron supports extra_dhcp_opts since Havana * Hence remove boolean check dhcp_options_enabled Closes-Bug: #1214162 DocImpact Change-Id: I9af217a87a237e078e70332cbed1c80ad4d5db0a
1 parent 00cfbf8 commit 3292103

File tree

3 files changed

+5
-24
lines changed

3 files changed

+5
-24
lines changed

etc/nova/nova.conf.sample

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,9 +1281,6 @@
12811281
# requests. (string value)
12821282
#neutron_ca_certificates_file=<None>
12831283

1284-
# Use per-port DHCP options with Neutron (boolean value)
1285-
#dhcp_options_enabled=false
1286-
12871284

12881285
#
12891286
# Options defined in nova.network.rpcapi

nova/network/neutronv2/api.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,7 @@
8686
cfg.StrOpt('neutron_ca_certificates_file',
8787
help='Location of ca certificates file to use for '
8888
'neutron client requests.'),
89-
cfg.BoolOpt('dhcp_options_enabled',
90-
default=False,
91-
help='Use per-port DHCP options with Neutron'),
92-
]
89+
]
9390

9491
CONF = cfg.CONF
9592
CONF.register_opts(neutron_opts)
@@ -227,10 +224,7 @@ def allocate_for_instance(self, context, instance, **kwargs):
227224
raise exception.InvalidInput(
228225
reason=msg % instance['display_name'])
229226
requested_networks = kwargs.get('requested_networks')
230-
# Note: (dkehn) this option check should be removed as soon as support
231-
# in neutron released, see https://bugs.launchpad.net/nova/+bug/1214162
232-
if CONF.dhcp_options_enabled:
233-
dhcp_opts = kwargs.get('dhcp_options', None)
227+
dhcp_opts = kwargs.get('dhcp_options', None)
234228
ports = {}
235229
fixed_ips = {}
236230
net_ids = []

nova/tests/network/test_neutronv2.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,10 @@ def _stub_allocate_for_instance(self, net_idx=1, **kwargs):
275275
self.mox.StubOutWithMock(api, '_get_instance_nw_info')
276276
has_portbinding = False
277277
has_extra_dhcp_opts = False
278-
# Note: (dkehn) this option check should be removed as soon as support
279-
# in neutron released, see https://bugs.launchpad.net/nova/+bug/1214162
280-
if (cfg.CONF.dhcp_options_enabled == True and kwargs.get(
281-
'dhcp_options', None) != None):
278+
dhcp_options = kwargs.get('dhcp_options')
279+
if dhcp_options is not None:
282280
has_extra_dhcp_opts = True
283-
dhcp_options = kwargs.get('dhcp_options')
281+
284282
if kwargs.get('portbinding'):
285283
has_portbinding = True
286284
api.extensions[constants.PORTBINDING_EXT] = 1
@@ -1796,16 +1794,9 @@ def setUp(self):
17961794
self.moxed_client)
17971795

17981796
def test_allocate_for_instance_1_with_extra_dhcp_opts_turned_off(self):
1799-
# Note: (dkehn) this option check should be removed as soon as support
1800-
# in neutron released, see https://bugs.launchpad.net/nova/+bug/1214162
1801-
CONF.set_override('dhcp_options_enabled', True)
18021797
self._allocate_for_instance(1, extra_dhcp_opts=False)
1803-
CONF.set_override('dhcp_options_enabled', False)
18041798

18051799
def test_allocate_for_instance_extradhcpopts(self):
1806-
# Note: (dkehn) this option check should be removed as soon as support
1807-
# in neutron released, see https://bugs.launchpad.net/nova/+bug/1214162
1808-
CONF.set_override('dhcp_options_enabled', True)
18091800
dhcp_opts = [{'opt_name': 'bootfile-name',
18101801
'opt_value': 'pxelinux.0'},
18111802
{'opt_name': 'tftp-server',
@@ -1814,7 +1805,6 @@ def test_allocate_for_instance_extradhcpopts(self):
18141805
'opt_value': '123.123.123.456'}]
18151806

18161807
self._allocate_for_instance(1, dhcp_options=dhcp_opts)
1817-
CONF.set_override('dhcp_options_enabled', False)
18181808

18191809

18201810
class TestNeutronClientForAdminScenarios(test.TestCase):

0 commit comments

Comments
 (0)