Merge "Stop preloading Admin Volumes tabs"

This commit is contained in:
Jenkins 2014-08-19 01:53:39 +00:00 committed by Gerrit Code Review
commit be8dc827cf
2 changed files with 3 additions and 23 deletions

View File

@ -34,6 +34,7 @@ class VolumeTab(tabs.TableTab, volumes_tabs.VolumeTableMixIn):
name = _("Volumes")
slug = "volumes_tab"
template_name = "admin/volumes/volumes/volumes_tables.html"
preload = False
def get_volumes_data(self):
volumes = self._get_volumes(search_opts={'all_tenants': True})
@ -71,6 +72,7 @@ class SnapshotTab(tabs.TableTab):
name = _("Volume Snapshots")
slug = "snapshots_tab"
template_name = ("horizon/common/_detail_table.html")
preload = False
def get_volume_snapshots_data(self):
if api.base.is_service_enabled(self.request, 'volume'):

View File

@ -25,8 +25,7 @@ from openstack_dashboard.test import helpers as test
class VolumeTests(test.BaseAdminViewTests):
@test.create_stubs({api.nova: ('server_list',),
cinder: ('volume_list',
'volume_type_list',
'volume_snapshot_list'),
'volume_type_list',),
keystone: ('tenant_list',)})
def test_index(self):
cinder.volume_list(IsA(http.HttpRequest), search_opts={
@ -36,15 +35,6 @@ class VolumeTests(test.BaseAdminViewTests):
.AndReturn([self.servers.list(), False])
cinder.volume_type_list(IsA(http.HttpRequest)).\
AndReturn(self.volume_types.list())
keystone.tenant_list(IsA(http.HttpRequest)) \
.AndReturn([self.tenants.list(), False])
cinder.volume_snapshot_list(IsA(http.HttpRequest), search_opts={
'all_tenants': True}).\
AndReturn(self.cinder_volume_snapshots.list())
cinder.volume_list(IsA(http.HttpRequest), search_opts={
'all_tenants': True}).\
AndReturn(self.cinder_volumes.list())
keystone.tenant_list(IsA(http.HttpRequest)). \
AndReturn([self.tenants.list(), False])
@ -123,21 +113,9 @@ class VolumeTests(test.BaseAdminViewTests):
@test.create_stubs({api.nova: ('server_list',),
cinder: ('volume_list',
'volume_type_list',
'volume_snapshot_list',),
keystone: ('tenant_list',)})
def test_snapshot_tab(self):
cinder.volume_list(IsA(http.HttpRequest), search_opts={
'all_tenants': True}).\
AndReturn(self.cinder_volumes.list())
api.nova.server_list(IsA(http.HttpRequest), search_opts={
'all_tenants': True}).\
AndReturn([self.servers.list(), False])
cinder.volume_type_list(IsA(http.HttpRequest)).\
AndReturn(self.volume_types.list())
keystone.tenant_list(IsA(http.HttpRequest)). \
AndReturn([self.tenants.list(), False])
cinder.volume_snapshot_list(IsA(http.HttpRequest), search_opts={
'all_tenants': True}). \
AndReturn(self.cinder_volume_snapshots.list())