~ubuntu-branches/ubuntu/vivid/horizon/vivid-proposed

« back to all changes in this revision

Viewing changes to openstack_dashboard/dashboards/admin/info/tabs.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-03-31 17:31:49 UTC
  • mfrom: (1.1.38)
  • Revision ID: package-import@ubuntu.com-20140331173149-f28yjk2s8pt15fqj
Tags: 1:2014.1~rc1-0ubuntu1
* New upstream release candidate (LP: #1288245).
  - d/static/*: Refreshed assets for new upstream release.
* d/theme/*: Refresh Ubuntu theme against Icehouse templates (LP: #1291653).

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from openstack_dashboard.api import keystone
22
22
from openstack_dashboard.api import neutron
23
23
from openstack_dashboard.api import nova
 
24
from openstack_dashboard.usage import quotas
24
25
 
25
26
from openstack_dashboard.dashboards.admin.info import constants
26
27
from openstack_dashboard.dashboards.admin.info import tables
79
80
        return agents
80
81
 
81
82
 
 
83
class DefaultQuotasTab(tabs.TableTab):
 
84
    table_classes = (tables.QuotasTable,)
 
85
    name = _("Default Quotas")
 
86
    slug = "quotas"
 
87
    template_name = constants.INFO_DETAIL_TEMPLATE_NAME
 
88
 
 
89
    def get_quotas_data(self):
 
90
        request = self.tab_group.request
 
91
        try:
 
92
            data = quotas.get_default_quota_data(request)
 
93
        except Exception:
 
94
            data = []
 
95
            exceptions.handle(self.request, _('Unable to get quota info.'))
 
96
        return data
 
97
 
 
98
 
82
99
class SystemInfoTabs(tabs.TabGroup):
83
100
    slug = "system_info"
84
101
    tabs = (ServicesTab, NovaServicesTab,
85
 
            NetworkAgentsTab)
 
102
            NetworkAgentsTab, DefaultQuotasTab)
86
103
    sticky = True