Remove nova networking

This is essentially dead code elimination
from manila-ui at this point since manila
and python-manilaclient dropped support
in the Ocata release.

Change-Id: I92e87282020047c7fad055cae92f2382c4193597
Partially-implements: bp remove-nova-net-plugin
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
This commit is contained in:
Goutham Pacha Ravi 2021-04-16 18:31:22 -07:00
parent 89a90ff977
commit 4edb837a1b
6 changed files with 9 additions and 28 deletions

View File

@ -32,9 +32,6 @@
<dt>{% trans "Subnet" %}</dt> <dt>{% trans "Subnet" %}</dt>
<dd>{{ share_network.neutron_subnet}}</dd> <dd>{{ share_network.neutron_subnet}}</dd>
{% endif %} {% endif %}
{% if share_network.nova_net %}
<dd>{{ share_network.nova_net }}</dd>
{% endif %}
</dl> </dl>
</div> </div>

View File

@ -57,27 +57,18 @@ class Create(forms.SelfHandlingForm):
self.fields[subnet_field_name].choices = [ self.fields[subnet_field_name].choices = [
(' ', ' ')] + [(choice.id, choice.name_or_id) (' ', ' ')] + [(choice.id, choice.name_or_id)
for choice in subnet_choices] for choice in subnet_choices]
else:
self.fields['nova_net_id'] = forms.ChoiceField(
choices=[(' ', ' ')] + [(choice.id, choice.name_or_id)
for choice in net_choices],
label=_("Nova Net"), widget=forms.Select(
attrs={'class': 'switched', 'data-slug': 'net'}))
def handle(self, request, data): def handle(self, request, data):
try: try:
send_data = {'name': data['name']} send_data = {'name': data['name']}
if data['description']: if data['description']:
send_data['description'] = data['description'] send_data['description'] = data['description']
share_net_id = data.get('neutron_net_id', data.get('nova_net_id')) share_net_id = data.get('neutron_net_id')
share_net_id = share_net_id.strip()
if self.neutron_enabled and share_net_id: if self.neutron_enabled and share_net_id:
send_data['neutron_net_id'] = share_net_id send_data['neutron_net_id'] = share_net_id.strip()
subnet_key = 'subnet-choices-%s' % share_net_id subnet_key = 'subnet-choices-%s' % share_net_id
if subnet_key in data: if subnet_key in data:
send_data['neutron_subnet_id'] = data[subnet_key] send_data['neutron_subnet_id'] = data[subnet_key]
elif not self.neutron_enabled and share_net_id:
send_data['nova_net_id'] = data['nova_net_id']
share_network = manila.share_network_create(request, **send_data) share_network = manila.share_network_create(request, **send_data)
messages.success(request, _('Successfully created share' messages.success(request, _('Successfully created share'
' network: %s') % send_data['name']) ' network: %s') % send_data['name'])

View File

@ -20,7 +20,6 @@ from openstack_dashboard.api import base
from openstack_dashboard.api import neutron from openstack_dashboard.api import neutron
from manila_ui.api import manila from manila_ui.api import manila
from manila_ui.api import network
DELETABLE_STATES = ("INACTIVE", "ERROR") DELETABLE_STATES = ("INACTIVE", "ERROR")
@ -91,9 +90,6 @@ class UpdateRow(tables.Row):
request, share_net.neutron_net_id).name_or_id request, share_net.neutron_net_id).name_or_id
share_net.neutron_subnet = neutron.subnet_get( share_net.neutron_subnet = neutron.subnet_get(
request, share_net.neutron_subnet_id).name_or_id request, share_net.neutron_subnet_id).name_or_id
else:
share_net.nova_net = network.network_get(
request, share_net.nova_net_id).name_or_id
return share_net return share_net

View File

@ -25,9 +25,6 @@
<dt>{% trans "Subnet" %}</dt> <dt>{% trans "Subnet" %}</dt>
<dd>{{ share_network.neutron_subnet}}</dd> <dd>{{ share_network.neutron_subnet}}</dd>
{% endif %} {% endif %}
{% if share_network.nova_net %}
<dd>{{ share_network.nova_net }}</dd>
{% endif %}
</dl> </dl>
</div> </div>

View File

@ -24,7 +24,6 @@ from openstack_dashboard.api import base
from openstack_dashboard.api import neutron from openstack_dashboard.api import neutron
from manila_ui.api import manila from manila_ui.api import manila
from manila_ui.api import network
from manila_ui.dashboards.project.share_networks import forms as sn_forms from manila_ui.dashboards.project.share_networks import forms as sn_forms
from manila_ui.dashboards.project.share_networks import tables as sn_tables from manila_ui.dashboards.project.share_networks import tables as sn_tables
from manila_ui.dashboards.project.share_networks import tabs as sn_tabs from manila_ui.dashboards.project.share_networks import tabs as sn_tabs
@ -123,12 +122,6 @@ class Detail(tabs.TabView):
except ( except (
neutron.neutron_client.exceptions.NeutronClientException): neutron.neutron_client.exceptions.NeutronClientException):
share_net.neutron_subnet = _("Unknown") share_net.neutron_subnet = _("Unknown")
else:
try:
share_net.nova_net = network.network_get(
self.request, share_net.nova_net_id).name_or_id
except Exception:
share_net.nova_net = _("Unknown")
share_net.sec_services = ( share_net.sec_services = (
manila.share_network_security_service_list( manila.share_network_security_service_list(

View File

@ -0,0 +1,7 @@
---
upgrade:
- |
Support for nova networking has been removed. Manila and the
manilaclient sdk dropped support for nova network in the Ocata release
(Feb 2017). So this should not have an impact on deployers running later
releases, and this note is only informational.