Skip to content

Commit 3b32669

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Removes check CONF.dhcp_options_enabled from nova"
2 parents b424db7 + 3292103 commit 3b32669

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
@@ -1286,9 +1286,6 @@
12861286
# requests. (string value)
12871287
#neutron_ca_certificates_file=<None>
12881288

1289-
# Use per-port DHCP options with Neutron (boolean value)
1290-
#dhcp_options_enabled=false
1291-
12921289

12931290
#
12941291
# 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
@@ -274,12 +274,10 @@ def _stub_allocate_for_instance(self, net_idx=1, **kwargs):
274274
self.mox.StubOutWithMock(api, 'get_instance_nw_info')
275275
has_portbinding = False
276276
has_extra_dhcp_opts = False
277-
# Note: (dkehn) this option check should be removed as soon as support
278-
# in neutron released, see https://bugs.launchpad.net/nova/+bug/1214162
279-
if (cfg.CONF.dhcp_options_enabled == True and kwargs.get(
280-
'dhcp_options', None) != None):
277+
dhcp_options = kwargs.get('dhcp_options')
278+
if dhcp_options is not None:
281279
has_extra_dhcp_opts = True
282-
dhcp_options = kwargs.get('dhcp_options')
280+
283281
if kwargs.get('portbinding'):
284282
has_portbinding = True
285283
api.extensions[constants.PORTBINDING_EXT] = 1
@@ -1810,16 +1808,9 @@ def setUp(self):
18101808
self.moxed_client)
18111809

18121810
def test_allocate_for_instance_1_with_extra_dhcp_opts_turned_off(self):
1813-
# Note: (dkehn) this option check should be removed as soon as support
1814-
# in neutron released, see https://bugs.launchpad.net/nova/+bug/1214162
1815-
CONF.set_override('dhcp_options_enabled', True)
18161811
self._allocate_for_instance(1, extra_dhcp_opts=False)
1817-
CONF.set_override('dhcp_options_enabled', False)
18181812

18191813
def test_allocate_for_instance_extradhcpopts(self):
1820-
# Note: (dkehn) this option check should be removed as soon as support
1821-
# in neutron released, see https://bugs.launchpad.net/nova/+bug/1214162
1822-
CONF.set_override('dhcp_options_enabled', True)
18231814
dhcp_opts = [{'opt_name': 'bootfile-name',
18241815
'opt_value': 'pxelinux.0'},
18251816
{'opt_name': 'tftp-server',
@@ -1828,7 +1819,6 @@ def test_allocate_for_instance_extradhcpopts(self):
18281819
'opt_value': '123.123.123.456'}]
18291820

18301821
self._allocate_for_instance(1, dhcp_options=dhcp_opts)
1831-
CONF.set_override('dhcp_options_enabled', False)
18321822

18331823

18341824
class TestNeutronClientForAdminScenarios(test.TestCase):

0 commit comments

Comments
 (0)