Fix VNF catalog does not show service types

Change-Id: I31376c29af1a2584632e9792974cba9ce4ae7f16
Closes-Bug: #1774361
This commit is contained in:
Trinh Nguyen 2018-06-05 22:47:04 +09:00
parent 9c7bccbe2f
commit 417687aa2d
2 changed files with 5 additions and 8 deletions

View File

@ -61,7 +61,7 @@ class VNFCatalogTable(tables.DataTable):
verbose_name=_("Name"))
description = tables.Column('description',
verbose_name=_("Description"))
services = tables.Column('service types',
services = tables.Column('service_types',
verbose_name=_("Service Types"))
id = tables.Column('id',
verbose_name=_("Catalog Id"))

View File

@ -24,11 +24,11 @@ from tacker_horizon.openstack_dashboard.dashboards.nfv.vnfcatalog import tables
class VNFCatalogItem(object):
def __init__(self, name, description, services, vnfd_id):
def __init__(self, name, description, service_types, vnfd_id):
self.id = vnfd_id
self.name = name
self.description = description
self.services = services
self.service_types = service_types
class VNFCatalogTab(tabs.TableTab):
@ -43,16 +43,13 @@ class VNFCatalogTab(tabs.TableTab):
def get_vnfcatalog_data(self):
try:
# marker = self.request.GET.get(
# tables.VNFCatalogTable._meta.pagination_param, None)
self._has_more = False
catalogs = []
vnfds = api.tacker.vnfd_list(self.request,
template_source="onboarded")
for vnfd in vnfds:
s_types = [s_type for s_type in vnfd['service_types']
if s_type != 'vnfd']
s_types = [s_type for s_type in vnfd['service_types']]
s_types_string = ""
if len(s_types) > 0:
s_types_string = ', '.join(