From a68cb66802bc591a3b15143b680b9e08bf6e4fc7 Mon Sep 17 00:00:00 2001 From: Tzu-Mainn Chen Date: Thu, 25 Jul 2013 10:27:51 -0400 Subject: minor fixes to flavors * allow forms to appear with js turned off * fix mock running_vms data * re-re-name 'ram' to 'memory' Change-Id: If8880a85ba2bc6d7f1fe6a003752f95d3b0ad3cb --- openstack_dashboard/api/tuskar.py | 10 +++++----- .../templates/resource_management/flavors/create.html | 2 +- .../templates/resource_management/flavors/edit.html | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/openstack_dashboard/api/tuskar.py b/openstack_dashboard/api/tuskar.py index da2cef0e..20552b3e 100644 --- a/openstack_dashboard/api/tuskar.py +++ b/openstack_dashboard/api/tuskar.py @@ -795,8 +795,8 @@ class FlavorTemplate(StringIdAPIResourceWrapper): @property def running_virtual_machines(self): - # arbitrary number - return len(self.resource_classes) * 2 + # FIXME: arbitrary number + return randint(0, int(self.cpu.value)) # defines a random average of capacity - API should probably be able to # determine average of capacity based on capacity value and obejct_id @@ -821,7 +821,7 @@ class FlavorTemplate(StringIdAPIResourceWrapper): Capacity.update(request, template.cpu.id, template._apiresource, 'cpu', cpu, '') Capacity.update(request, template.memory.id, template._apiresource, - 'ram', ram, 'MB') + 'memory', memory, 'MB') Capacity.update(request, template.storage.id, template._apiresource, 'storage', storage, 'GB') Capacity.update(request, template.ephemeral_disk.id, @@ -911,8 +911,8 @@ class Flavor(StringIdAPIResourceWrapper): @property def running_virtual_machines(self): - # arbitrary number - return len(self.resource_classes) * 2 + # FIXME: arbitrary number + return randint(0, int(self.cpu.value)) # defines a random average of capacity - API should probably be able to # determine average of capacity based on capacity value and obejct_id diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/templates/resource_management/flavors/create.html b/openstack_dashboard/dashboards/infrastructure/resource_management/templates/resource_management/flavors/create.html index ba990156..afa99a12 100644 --- a/openstack_dashboard/dashboards/infrastructure/resource_management/templates/resource_management/flavors/create.html +++ b/openstack_dashboard/dashboards/infrastructure/resource_management/templates/resource_management/flavors/create.html @@ -6,6 +6,6 @@ {% include "horizon/common/_page_header.html" with title=_("Create Flavor") %} {% endblock page_header %} -{% block infrastructure_main %} +{% block main %} {% include "infrastructure/resource_management/flavors/_create.html" %} {% endblock %} diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/templates/resource_management/flavors/edit.html b/openstack_dashboard/dashboards/infrastructure/resource_management/templates/resource_management/flavors/edit.html index 91da5501..1ccb910b 100644 --- a/openstack_dashboard/dashboards/infrastructure/resource_management/templates/resource_management/flavors/edit.html +++ b/openstack_dashboard/dashboards/infrastructure/resource_management/templates/resource_management/flavors/edit.html @@ -6,6 +6,7 @@ {% include "horizon/common/_page_header.html" with title=_("Edit Flavor") %} {% endblock page_header %} -{% block infrastructure_main %} +{% block main %} {% include "infrastructure/resource_management/flavors/_edit.html" %} {% endblock %} + -- cgit v1.2.1