From 2e355837fa04602a36fa7bf338f497636c608f13 Mon Sep 17 00:00:00 2001 From: Frode Nordahl Date: Fri, 6 May 2016 14:36:00 +0200 Subject: [PATCH] Remove deprecated default_*_subnet_pool options These options were deprecated in Mitaka and this commit removes them from Newton. Revert relaxation of _check_subnet_data function. It is no longer allowed to pass empty 'subnetpool_id'. Change-Id: I86df242a7dda84ef197216aa5c593417038fae3f Closes-Bug: #1579035 Related-Bug: #1551333 --- doc/source/topics/settings.rst | 35 ------------------- .../dashboards/project/networks/workflows.py | 28 ++++----------- .../local/local_settings.py.example | 12 ------- ...t-pool-label-options-9aeaa816ad6cc2f8.yaml | 8 +++++ 4 files changed, 14 insertions(+), 69 deletions(-) create mode 100644 releasenotes/notes/removal-of-default-subnet-pool-label-options-9aeaa816ad6cc2f8.yaml diff --git a/doc/source/topics/settings.rst b/doc/source/topics/settings.rst index a6179ec9d..883e02bd5 100644 --- a/doc/source/topics/settings.rst +++ b/doc/source/topics/settings.rst @@ -1298,41 +1298,6 @@ subnet with no router if your Neutron backend allows it. .. versionadded:: 8.0.0(Liberty) -``default_ipv4_subnet_pool_label`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. versionadded:: 8.0.0(Liberty) - -Default: ``None`` (Disabled) - -Neutron can be configured with a default Subnet Pool to be used for IPv4 -subnet-allocation. Specify the label you wish to display in the Address pool -selector on the create subnet step if you want to use this feature. - -This option is now marked as "deprecated" and will be removed in Newton or -a later release. If there exists a default Subnet Pool it will be automatically -detected through the Neutron API and the label will be set to the name of the -default Subnet Pool. - -``default_ipv6_subnet_pool_label`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. versionadded:: 8.0.0(Liberty) - -Default: ``None`` (Disabled) - -Neutron can be configured with a default Subnet Pool to be used for IPv6 -subnet-allocation. Specify the label you wish to display in the Address pool -selector on the create subnet step if you want to use this feature. - -When using Liberty Neutron you must set this to enable IPv6 Prefix Delegation -in a PD-capable environment. - -This option is now marked as "deprecated" and will be removed in Newton or -a later release. If there exists a default Subnet Pool it will be automatically -detected through the Neutron API and the label will be set to the name of the -default Subnet Pool. - ``default_dns_nameservers``: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/openstack_dashboard/dashboards/project/networks/workflows.py b/openstack_dashboard/dashboards/project/networks/workflows.py index eee7b6db0..07af80a4c 100644 --- a/openstack_dashboard/dashboards/project/networks/workflows.py +++ b/openstack_dashboard/dashboards/project/networks/workflows.py @@ -256,24 +256,6 @@ class CreateSubnetInfoAction(workflows.Action): def get_subnetpool_choices(self, request): subnetpool_choices = [('', _('Select a pool'))] - default_ipv6_subnet_pool_label = \ - getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {}).get( - 'default_ipv6_subnet_pool_label', None) - default_ipv4_subnet_pool_label = \ - getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {}).get( - 'default_ipv4_subnet_pool_label', None) - - if default_ipv6_subnet_pool_label: - subnetpool_dict = {'ip_version': 6, - 'name': default_ipv6_subnet_pool_label} - subnetpool = api.neutron.SubnetPool(subnetpool_dict) - subnetpool_choices.append(('', subnetpool)) - - if default_ipv4_subnet_pool_label: - subnetpool_dict = {'ip_version': 4, - 'name': default_ipv4_subnet_pool_label} - subnetpool = api.neutron.SubnetPool(subnetpool_dict) - subnetpool_choices.append(('', subnetpool)) for subnetpool in api.neutron.subnetpool_list(request): subnetpool_choices.append((subnetpool.id, subnetpool)) @@ -291,11 +273,13 @@ class CreateSubnetInfoAction(workflows.Action): gateway_ip = cleaned_data.get('gateway_ip') no_gateway = cleaned_data.get('no_gateway') address_source = cleaned_data.get('address_source') + subnetpool = cleaned_data.get('subnetpool') - # When creating network from a pool it is allowed to supply empty - # subnetpool_id signaling that Neutron should choose the default - # pool configured by the operator. This is also part of the IPv6 - # Prefix Delegation Workflow. + if not subnetpool and address_source == 'subnetpool': + msg = _('Specify "Address pool" or select ' + '"Enter Network Address manually" and specify ' + '"Network Address".') + raise forms.ValidationError(msg) if not cidr and address_source != 'subnetpool': msg = _('Specify "Network Address" or ' 'clear "Create Subnet" checkbox in previous step.') diff --git a/openstack_dashboard/local/local_settings.py.example b/openstack_dashboard/local/local_settings.py.example index 862628627..2c0c309cf 100644 --- a/openstack_dashboard/local/local_settings.py.example +++ b/openstack_dashboard/local/local_settings.py.example @@ -278,18 +278,6 @@ OPENSTACK_NEUTRON_NETWORK = { # real deployments # 'default_dns_nameservers': ["8.8.8.8", "8.8.4.4", "208.67.222.222"], - # Neutron can be configured with a default Subnet Pool to be used for IPv4 - # subnet-allocation. Specify the label you wish to display in the Address - # pool selector on the create subnet step if you want to use this feature. - 'default_ipv4_subnet_pool_label': None, - - # Neutron can be configured with a default Subnet Pool to be used for IPv6 - # subnet-allocation. Specify the label you wish to display in the Address - # pool selector on the create subnet step if you want to use this feature. - # You must set this to enable IPv6 Prefix Delegation in a PD-capable - # environment. - 'default_ipv6_subnet_pool_label': None, - # The profile_support option is used to detect if an external router can be # configured via the dashboard. When using specific plugins the # profile_support can be turned on if needed. diff --git a/releasenotes/notes/removal-of-default-subnet-pool-label-options-9aeaa816ad6cc2f8.yaml b/releasenotes/notes/removal-of-default-subnet-pool-label-options-9aeaa816ad6cc2f8.yaml new file mode 100644 index 000000000..a35682a3d --- /dev/null +++ b/releasenotes/notes/removal-of-default-subnet-pool-label-options-9aeaa816ad6cc2f8.yaml @@ -0,0 +1,8 @@ +--- +deprecations: + - The 'default_ipv4_subnet_pool_label' and 'default_ipv6_subnet_pool_label' + options were deprecated in the Mitaka release and are no longer valid in + the Newton release. Starting with Mitaka you can create one default + subnet pool per address family through the Neutron API. These subnet + pools will automatically show up in the subnet pool list using the name + of the pool as label.