Merge "Only show charts for provisioned nodes"

This commit is contained in:
Jenkins 2015-04-14 12:50:03 +00:00 committed by Gerrit Code Review
commit 0006a339b7
3 changed files with 8 additions and 3 deletions

View File

@ -195,7 +195,7 @@ class FlavorsTest(test.BaseAdminViewTests):
self.assertEqual(get_mock.call_count, 1)
self.assertEqual(plan_mock.call_count, 2)
self.assertEqual(roles_mock.call_count, 1)
self.assertEqual(role_flavor_mock.call_count, 4)
self.assertEqual(role_flavor_mock.call_count, 8)
self.assertTemplateUsed(res, 'infrastructure/flavors/details.html')
def test_details(self):
@ -224,7 +224,7 @@ class FlavorsTest(test.BaseAdminViewTests):
self.assertEqual(flavor_mock.call_count, 1)
self.assertEqual(plan_mock.call_count, 2)
self.assertEqual(roles_mock.call_count, 1)
self.assertEqual(role_flavor_mock.call_count, 4)
self.assertEqual(role_flavor_mock.call_count, 8)
self.assertEqual(stack_mock.call_count, 1)
self.assertEqual(count_mock.call_count, 4)
self.assertTemplateUsed(res, 'infrastructure/flavors/details.html')

View File

@ -99,4 +99,5 @@ class DetailView(horizon.tables.DataTableView):
plan = api.tuskar.Plan.get_the_plan(self.request)
return [role for role in api.tuskar.Role.list(self.request)
if role.flavor(plan).id == flavor_id]
if role.flavor(plan)
and role.flavor(plan).id == flavor_id]

View File

@ -88,11 +88,15 @@
</div>
</div>
<div>
{% if nodes_provisioned_count or nodes_provisioning_count %}
{% url 'horizon:infrastructure:nodes:nodes_performance' as node_perf_url %}
{% include "infrastructure/_performance_chart_box.html" with meter_conf=meter_conf node_perf_url=node_perf_url col_size=2 %}
{% endif %}
</div>
</div>
{% if nodes_provisioned_count or nodes_provisioning_count %}
{% include "infrastructure/_top_5_box.html" %}
{% endif %}
{% if nodes_on_discovery_count or nodes_discovered_count or nodes_discovery_failed_count %}
<h3>{% trans "Nodes Discovery" %}</h3>
<hr>