Commit e241ad50 by Kálmán Viktor

vm: check all vmdriver queues

also display the queue statuses on node detail

Closes #426
parent cb2d9cff
Pipeline #75 failed with stage
in 0 seconds
......@@ -56,6 +56,11 @@
<span class="label label-warning">{% trans "Offline" %}</span>
{% endif %}
</div>
<div>
{% for k, v in queues.iteritems %}
<span class="label label-{% if v %}success{% else %}danger{% endif %}">{{ k }}</span>
{% endfor %}
</div>
</div>
<div class="col-md-10" id="node-detail-pane">
<div class="panel panel-default" id="node-detail-panel">
......
......@@ -37,6 +37,7 @@ from django_tables2 import SingleTableView
from firewall.models import Host
from vm.models import Node, NodeActivity, Trait
from vm.tasks.vm_tasks import check_queue
from ..forms import TraitForm, HostForm, NodeForm
from ..tables import NodeListTable
......@@ -107,6 +108,13 @@ class NodeDetailView(LoginRequiredMixin,
context['trait_form'] = form
context['graphite_enabled'] = (
settings.GRAPHITE_URL is not None)
node_hostname = self.object.host.hostname
context['queues'] = {
'vmcelery.fast': check_queue(node_hostname, "vm", "fast"),
'vmcelery.slow': check_queue(node_hostname, "vm", "slow"),
'netcelery.fast': check_queue(node_hostname, "net", "fast"),
}
return context
def post(self, request, *args, **kwargs):
......
......@@ -160,6 +160,8 @@ class Node(OperatedMixin, TimeStampedModel):
"""
try:
self.get_remote_queue_name("vm", "fast")
self.get_remote_queue_name("vm", "slow")
self.get_remote_queue_name("net", "fast")
except:
return False
else:
......
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