Make Port Details VNIC type translatable

Port Details VNIC type value was not translatable.

Change-Id: I64e16adfa8ebf08fcc81a5648f8b0a0f4404c344
Closes-Bug: #1462484
(cherry picked from commit ae0a7039b3)
This commit is contained in:
Itxaka 2015-12-14 11:43:34 +01:00 committed by Itxaka Serrano Garcia
parent 83cbfc2bee
commit 0f652fd6a7
1 changed files with 4 additions and 0 deletions

View File

@ -31,6 +31,7 @@ from openstack_dashboard.dashboards.project.networks.ports \
STATE_DICT = dict(project_tables.DISPLAY_CHOICES)
STATUS_DICT = dict(project_tables.STATUS_DISPLAY_CHOICES)
VNIC_TYPES = dict(project_forms.VNIC_TYPES)
class DetailView(tabs.TabView):
@ -48,6 +49,9 @@ class DetailView(tabs.TabView):
port.admin_state)
port.status_label = STATUS_DICT.get(port.status,
port.status)
if port.get('binding__vnic_type'):
port.binding__vnic_type = VNIC_TYPES.get(
port.binding__vnic_type, port.binding__vnic_type)
except Exception:
port = []
redirect = self.get_redirect_url()