38 lines
1.0 KiB
Python
Executable File
38 lines
1.0 KiB
Python
Executable File
#
|
|
# Copyright (c) 2013-2016 Wind River Systems, Inc.
|
|
#
|
|
# The right to copy, distribute, modify, or otherwise make use
|
|
# of this software may be licensed only pursuant to the terms
|
|
# of an applicable Wind River license agreement.
|
|
#
|
|
|
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
import horizon
|
|
from openstack_dashboard.api import base
|
|
from openstack_dashboard.dashboards.admin import dashboard
|
|
|
|
|
|
class Inventory(horizon.Panel):
|
|
name = _("Host Inventory")
|
|
slug = 'inventory'
|
|
# permissions = ('openstack.roles.admin',)
|
|
permissions = ('openstack.services.platform',)
|
|
|
|
def allowed(self, context):
|
|
if not base.is_service_enabled(context['request'], 'platform'):
|
|
return False
|
|
else:
|
|
return super(Inventory, self).allowed(context)
|
|
|
|
def nav(self, context):
|
|
if not base.is_service_enabled(context['request'], 'platform'):
|
|
return False
|
|
else:
|
|
return True
|
|
|
|
|
|
dashboard.Admin.register(Inventory)
|