Commit 019ee29f by Szabolcs Gelencser Committed by Szabolcs Gelencsér

Filter VxlanList by external networks

parent 6e1ae0b8
...@@ -25,6 +25,7 @@ import openstack_api ...@@ -25,6 +25,7 @@ import openstack_api
from braces.views import LoginRequiredMixin, SuperuserRequiredMixin from braces.views import LoginRequiredMixin, SuperuserRequiredMixin
from dashboard.forms import AclUserOrGroupAddForm from dashboard.forms import AclUserOrGroupAddForm
from dashboard.views import AclUpdateView, FormView, OperationView, PermissionDenied from dashboard.views import AclUpdateView, FormView, OperationView, PermissionDenied
from django.conf import settings
from django.contrib import messages from django.contrib import messages
from django.contrib.messages.views import SuccessMessageMixin from django.contrib.messages.views import SuccessMessageMixin
from django.core.exceptions import ( from django.core.exceptions import (
...@@ -980,7 +981,10 @@ class VxlanList(LoginRequiredMixin, SingleTableView): ...@@ -980,7 +981,10 @@ class VxlanList(LoginRequiredMixin, SingleTableView):
return ["network/vxlan-list.html"] return ["network/vxlan-list.html"]
def get_queryset(self): def get_queryset(self):
return openstack_api.neutron.network_list(self.request) all_networks = openstack_api.neutron.network_list(self.request)
networks = [n for n in all_networks
if n.name not in settings.FLAT_EXTERNAL_NETWORKS + settings.SMART_EXTERNAL_NETWORKS]
return networks
def get(self, *args, **kwargs): def get(self, *args, **kwargs):
if self.request.is_ajax(): if self.request.is_ajax():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment