Commit b6b57fa4 by Chif Gergő

Fix flake8 warning, rename function

parent 4fc8b149
Pipeline #658 failed with stage
in 0 seconds
......@@ -193,6 +193,7 @@ class NodeList(LoginRequiredMixin, GraphMixin, SingleTableView):
def get(self, *args, **kwargs):
if not self.request.user.has_perm('vm.view_statistics'):
raise PermissionDenied()
self.wrong_nodes_message()
if self.request.is_ajax():
nodes = Node.objects.all()
nodes = [{
......@@ -210,14 +211,14 @@ class NodeList(LoginRequiredMixin, GraphMixin, SingleTableView):
return super(NodeList, self).get(*args, **kwargs)
def get_queryset(self):
self.wrong_node_message()
return Node.objects.annotate(
number_of_VMs=Count('instance_set')).select_related('host')
def wrong_node_message(self):
def wrong_nodes_message(self):
for node in Node.objects.all():
if node.monitor_info is None:
messages.error(self.request, "Can't reach "+node.name+" monitor info")
messages.error(self.request,
"Can't reach " + node.name + " monitor info")
class NodeCreate(LoginRequiredMixin, SuperuserRequiredMixin, TemplateView):
......
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