Merge "Remove per-feature extension check method in api/neutron"
This commit is contained in:
commit
ad4eae9543
@ -34,7 +34,7 @@ class NetworkClient(object):
|
||||
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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -143,7 +143,7 @@ class BaseUsage(object):
|
||||
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')
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user