Merge "Remove unused system command "storage-usage-list""

This commit is contained in:
Zuul 2019-05-13 16:59:34 +00:00 committed by Gerrit Code Review
commit 09622b9221
3 changed files with 3 additions and 39 deletions

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2016 Wind River Systems, Inc.
# Copyright (c) 2016-2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -7,4 +7,3 @@
PREFIX = 'admin/storage_overview/'
STORAGE_OVERVIEW_TEMPLATE_NAME = PREFIX + 'storage_overview.html'
STORAGE_SERVICE_DETAIL_TEMPLATE_NAME = PREFIX + '_detail_storageservices.html'
STORAGE_USAGE_TEMPLATE_NAME = PREFIX + '_usage.html'

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2016-2018 Wind River Systems, Inc.
# Copyright (c) 2016-2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -8,25 +8,6 @@ from django.utils.translation import ugettext_lazy as _
from horizon import tables
class UsageTable(tables.DataTable):
be_type = tables.Column('backend', verbose_name=_('Backend type'))
be_name = tables.Column('name', verbose_name=_('Backend name'))
be_service = tables.Column('service_name', verbose_name=_('Service name'))
capacity = tables.Column('total_capacity',
verbose_name=_('Total Capacity (GiB)'))
free = tables.Column('free_capacity',
verbose_name=_('Free Capacity (GiB)'))
class Meta(object):
name = "usage"
hidden_title = False
verbose_name = _("Storage Services and Backends Usage")
multi_select = False
def get_object_id(self, datum):
return datum
class MonitorsTable(tables.DataTable):
host = tables.Column('host',
verbose_name=_('Host'))

View File

@ -13,7 +13,6 @@ from horizon import tabs
from starlingx_dashboard.api import base as stx_base
from starlingx_dashboard.api import ceph
from starlingx_dashboard.api import sysinv
from starlingx_dashboard.dashboards.admin.storage_overview import constants
from starlingx_dashboard.dashboards.admin.storage_overview import tables
@ -72,22 +71,7 @@ class StorageServicesTab(tabs.TableTab):
return stx_base.is_stx_region(request)
class StorageUsageTab(tabs.TableTab):
table_classes = (tables.UsageTable,)
name = _("Usage")
slug = "usage"
template_name = constants.STORAGE_USAGE_TEMPLATE_NAME
def get_usage_data(self):
try:
return sysinv.storage_usage_list(self.request)
except Exception:
LOG.error("Exception requesting storage usage information")
return []
class StorageOverviewTabs(tabs.TabGroup):
slug = "storage_overview"
tabs = (StorageServicesTab, StorageUsageTab)
tabs = (StorageServicesTab, )
sticky = True