Skip to content

Commit

Permalink
Remove per-feature extension check method in api/neutron
Browse files Browse the repository at this point in the history
Change-Id: Ie1309d5a51e86a37c640e169d66c73724fc1c9ff
Closes-Bug: #1348075
  • Loading branch information
amotoki committed Jul 24, 2014
1 parent 8c9b86f commit cc25bd6
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion openstack_dashboard/api/network.py
Expand Up @@ -34,7 +34,7 @@ def __init__(self, request):
self.floating_ips = nova.FloatingIpManager(request)

if (neutron_enabled and
neutron.is_security_group_extension_supported(request)):
neutron.is_extension_supported(request, 'security-group')):
self.secgroups = neutron.SecurityGroupManager(request)
else:
self.secgroups = nova.SecurityGroupManager(request)
Expand Down
8 changes: 0 additions & 8 deletions openstack_dashboard/api/neutron.py
Expand Up @@ -864,14 +864,6 @@ def is_quotas_extension_supported(request):
return False


def is_security_group_extension_supported(request):
return is_extension_supported(request, 'security-group')


def is_agent_extension_supported(request):
return is_extension_supported(request, 'agent')


# Using this mechanism till a better plugin/sub-plugin detection
# mechanism is available.
# When using specific plugins the profile_support can be
Expand Down
2 changes: 1 addition & 1 deletion openstack_dashboard/dashboards/admin/info/tabs.py
Expand Up @@ -90,7 +90,7 @@ class NetworkAgentsTab(tabs.TableTab):
def allowed(self, request):
try:
return (base.is_service_enabled(request, 'network') and
neutron.is_agent_extension_supported(request))
neutron.is_extension_supported(request, 'agent'))
except Exception:
exceptions.handle(request, _('Unable to get network agents info.'))
return False
Expand Down
2 changes: 1 addition & 1 deletion openstack_dashboard/usage/base.py
Expand Up @@ -143,7 +143,7 @@ def get_neutron_limits(self):
neutron_quotas_supported = \
api.neutron.is_quotas_extension_supported(self.request)
neutron_sg_used = \
api.neutron.is_security_group_extension_supported(self.request)
api.neutron.is_extension_supported(self.request, 'security-group')
self._get_neutron_usage(self.limits, 'floatingip')
if neutron_sg_used:
self._get_neutron_usage(self.limits, 'security_group')
Expand Down
2 changes: 1 addition & 1 deletion openstack_dashboard/usage/quotas.py
Expand Up @@ -172,7 +172,7 @@ def get_disabled_quotas(request):
# Remove the nova network quotas
disabled_quotas.extend(['floating_ips', 'fixed_ips'])

if neutron.is_security_group_extension_supported(request):
if neutron.is_extension_supported(request, 'security-group'):
# If Neutron security group is supported, disable Nova quotas
disabled_quotas.extend(['security_groups', 'security_group_rules'])
else:
Expand Down

0 comments on commit cc25bd6

Please sign in to comment.