From f20b3b1e600c8739fece3b3c7083019016f9608f Mon Sep 17 00:00:00 2001 From: Kenji Ishii Date: Mon, 13 Jun 2016 17:54:53 +0900 Subject: [PATCH] Add check whether nova is enable or not in aggregate panel At the moment, aggregate panel has a check whether nova extension is enable or not. However it doesn't check nova is enable or not. So, when operator use non nova, error always occur by this check method. Therefore, this patch will add a check whether nova is enable or not. Closes-Bug: #1591920 Change-Id: I5ad37f16f70f1ac9b95c49b1363d1b23abbb1b94 --- openstack_dashboard/dashboards/admin/aggregates/panel.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openstack_dashboard/dashboards/admin/aggregates/panel.py b/openstack_dashboard/dashboards/admin/aggregates/panel.py index fd9cfd8c80..8fc5023d7a 100644 --- a/openstack_dashboard/dashboards/admin/aggregates/panel.py +++ b/openstack_dashboard/dashboards/admin/aggregates/panel.py @@ -16,7 +16,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from openstack_dashboard.api import nova +from openstack_dashboard import api LOG = logging.getLogger(__name__) @@ -30,7 +30,9 @@ class Aggregates(horizon.Panel): # extend basic permission-based check with a check to see whether # the Aggregates extension is even enabled in nova try: - if not nova.extension_supported('Aggregates', context['request']): + request = context['request'] + if not (api.base.is_service_enabled(request, 'compute') and + api.nova.extension_supported('Aggregates', request)): return False except Exception: LOG.error("Call to list supported extensions failed. This is "