Remove deprecated default subnetpools
These config options were deprecated in Mitaka. They can now be removed in Newton. Closes-Bug: #1594810 Related-Bug: #1501328 Change-Id: I6eea7d4465cf23df1d8dae26336633052dfab871
This commit is contained in:
parent
17d85e4748
commit
f7cc6a0107
@ -81,26 +81,6 @@ core_opts = [
|
||||
help=_("Maximum number of fixed ips per port. This option "
|
||||
"is deprecated and will be removed in the N "
|
||||
"release.")),
|
||||
cfg.StrOpt('default_ipv4_subnet_pool', deprecated_for_removal=True,
|
||||
help=_("Default IPv4 subnet pool to be used for automatic "
|
||||
"subnet CIDR allocation. "
|
||||
"Specifies by UUID the pool to be used in case where "
|
||||
"creation of a subnet is being called without a "
|
||||
"subnet pool ID. If not set then no pool "
|
||||
"will be used unless passed explicitly to the subnet "
|
||||
"create. If no pool is used, then a CIDR must be passed "
|
||||
"to create a subnet and that subnet will not be "
|
||||
"allocated from any pool; it will be considered part of "
|
||||
"the tenant's private address space. This option is "
|
||||
"deprecated for removal in the N release.")),
|
||||
cfg.StrOpt('default_ipv6_subnet_pool', deprecated_for_removal=True,
|
||||
help=_("Default IPv6 subnet pool to be used for automatic "
|
||||
"subnet CIDR allocation. "
|
||||
"Specifies by UUID the pool to be used in case where "
|
||||
"creation of a subnet is being called without a "
|
||||
"subnet pool ID. See the description for "
|
||||
"default_ipv4_subnet_pool for more information. This "
|
||||
"option is deprecated for removal in the N release.")),
|
||||
cfg.BoolOpt('ipv6_pd_enabled', default=False,
|
||||
help=_("Enables IPv6 Prefix Delegation for automatic subnet "
|
||||
"CIDR allocation. "
|
||||
|
@ -667,14 +667,6 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon,
|
||||
if subnetpool:
|
||||
return subnetpool['id']
|
||||
|
||||
# Until the default_subnet_pool config options are removed in the N
|
||||
# release, check for them after get_default_subnetpool returns None.
|
||||
# TODO(john-davidge): Remove after Mitaka release.
|
||||
if ip_version == 4 and cfg.CONF.default_ipv4_subnet_pool:
|
||||
return cfg.CONF.default_ipv4_subnet_pool
|
||||
if ip_version == 6 and cfg.CONF.default_ipv6_subnet_pool:
|
||||
return cfg.CONF.default_ipv6_subnet_pool
|
||||
|
||||
msg = _('No default subnetpool found for IPv%s') % ip_version
|
||||
raise exc.BadRequest(resource='subnets', msg=msg)
|
||||
|
||||
|
@ -3119,8 +3119,6 @@ class TestSubnetsV2(NeutronDbPluginV2TestCase):
|
||||
|
||||
def test_create_subnet_no_ip_version(self):
|
||||
with self.network() as network:
|
||||
cfg.CONF.set_override('default_ipv4_subnet_pool', None)
|
||||
cfg.CONF.set_override('default_ipv6_subnet_pool', None)
|
||||
data = {'subnet': {'network_id': network['network']['id'],
|
||||
'tenant_id': network['network']['tenant_id']}}
|
||||
subnet_req = self.new_create_request('subnets', data)
|
||||
@ -3131,7 +3129,6 @@ class TestSubnetsV2(NeutronDbPluginV2TestCase):
|
||||
with self.network() as network:
|
||||
tenant_id = network['network']['tenant_id']
|
||||
cfg.CONF.set_override('ipv6_pd_enabled', False)
|
||||
cfg.CONF.set_override('default_ipv6_subnet_pool', None)
|
||||
data = {'subnet': {'network_id': network['network']['id'],
|
||||
'ip_version': '6',
|
||||
'tenant_id': tenant_id}}
|
||||
|
@ -79,32 +79,6 @@ class DefaultSubnetpoolsExtensionTestCase(
|
||||
self.assertEqual(27, ip_net.prefixlen)
|
||||
self.assertEqual(subnetpool_id, subnet['subnetpool_id'])
|
||||
|
||||
def test_create_subnet_only_ip_version_v4_old(self):
|
||||
# TODO(john-davidge): Remove after Mitaka release.
|
||||
with self.network() as network:
|
||||
tenant_id = network['network']['tenant_id']
|
||||
subnetpool_prefix = '10.0.0.0/8'
|
||||
with self.subnetpool(prefixes=[subnetpool_prefix],
|
||||
admin=False,
|
||||
name="My subnet pool",
|
||||
tenant_id=tenant_id,
|
||||
min_prefixlen='25') as subnetpool:
|
||||
subnetpool_id = subnetpool['subnetpool']['id']
|
||||
cfg.CONF.set_override('default_ipv4_subnet_pool',
|
||||
subnetpool_id)
|
||||
data = {'subnet': {'network_id': network['network']['id'],
|
||||
'ip_version': '4',
|
||||
'prefixlen': '27',
|
||||
'tenant_id': tenant_id,
|
||||
'use_default_subnetpool': True}}
|
||||
subnet_req = self.new_create_request('subnets', data)
|
||||
res = subnet_req.get_response(self.api)
|
||||
subnet = self.deserialize(self.fmt, res)['subnet']
|
||||
ip_net = netaddr.IPNetwork(subnet['cidr'])
|
||||
self.assertIn(ip_net, netaddr.IPNetwork(subnetpool_prefix))
|
||||
self.assertEqual(27, ip_net.prefixlen)
|
||||
self.assertEqual(subnetpool_id, subnet['subnetpool_id'])
|
||||
|
||||
def test_create_subnet_only_ip_version_v6(self):
|
||||
# this test mirrors its v4 counterpart
|
||||
with self.network() as network:
|
||||
@ -130,32 +104,6 @@ class DefaultSubnetpoolsExtensionTestCase(
|
||||
self.assertIn(ip_net, netaddr.IPNetwork(subnetpool_prefix))
|
||||
self.assertEqual(64, ip_net.prefixlen)
|
||||
|
||||
def test_create_subnet_only_ip_version_v6_old(self):
|
||||
# TODO(john-davidge): Remove after Mitaka release.
|
||||
with self.network() as network:
|
||||
tenant_id = network['network']['tenant_id']
|
||||
subnetpool_prefix = '2000::/56'
|
||||
with self.subnetpool(prefixes=[subnetpool_prefix],
|
||||
admin=False,
|
||||
name="My ipv6 subnet pool",
|
||||
tenant_id=tenant_id,
|
||||
min_prefixlen='64') as subnetpool:
|
||||
subnetpool_id = subnetpool['subnetpool']['id']
|
||||
cfg.CONF.set_override('default_ipv6_subnet_pool',
|
||||
subnetpool_id)
|
||||
cfg.CONF.set_override('ipv6_pd_enabled', False)
|
||||
data = {'subnet': {'network_id': network['network']['id'],
|
||||
'ip_version': '6',
|
||||
'tenant_id': tenant_id,
|
||||
'use_default_subnetpool': True}}
|
||||
subnet_req = self.new_create_request('subnets', data)
|
||||
res = subnet_req.get_response(self.api)
|
||||
subnet = self.deserialize(self.fmt, res)['subnet']
|
||||
self.assertEqual(subnetpool_id, subnet['subnetpool_id'])
|
||||
ip_net = netaddr.IPNetwork(subnet['cidr'])
|
||||
self.assertIn(ip_net, netaddr.IPNetwork(subnetpool_prefix))
|
||||
self.assertEqual(64, ip_net.prefixlen)
|
||||
|
||||
def _test_create_subnet_V6_pd_modes(self, ra_addr_mode, expect_fail=False):
|
||||
cfg.CONF.set_override('ipv6_pd_enabled', True)
|
||||
with self.network() as network:
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
upgrade:
|
||||
- The configuration options for ``default_ipv4_subnet_pool`` and
|
||||
``default_ipv6_subnet_pool`` have been removed. Please use the
|
||||
``is_default`` option of the create/update subnetpool API instead.
|
Loading…
Reference in New Issue
Block a user