def __init__(self, request): neutron_enabled = base.is_service_enabled(request, 'network') if neutron_enabled: self.floating_ips = neutron.FloatingIpManager(request) else: self.floating_ips = nova.FloatingIpManager(request) if (neutron_enabled and neutron.is_extension_supported(request, 'security-group')): self.secgroups = neutron.SecurityGroupManager(request) else: self.secgroups = nova.SecurityGroupManager(request)
def __init__(self, request): # TODO(amotoki): neutron check needs to be dropped. # The network API wrapper can depend on neutron. neutron_enabled = base.is_service_enabled(request, 'network') if neutron_enabled: self.floating_ips = neutron.FloatingIpManager(request) else: self.floating_ips = None if (neutron_enabled and neutron.is_extension_supported(request, 'security-group')): self.secgroups = neutron.SecurityGroupManager(request) else: self.secgroups = None
def __init__(self, request): neutron_enabled = base.is_service_enabled(request, 'network') if neutron_enabled: self.floating_ips = neutron.FloatingIpManager(request) else: self.floating_ips = nova.FloatingIpManager(request) # Not all qunantum plugins support security group, # so we have enable_security_group configuration parameter. neutron_sg_enabled = getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {}).get('enable_security_group', True) if neutron_enabled and neutron_sg_enabled: self.secgroups = neutron.SecurityGroupManager(request) else: self.secgroups = nova.SecurityGroupManager(request)