summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzu-Mainn Chen <tzumainn@redhat.com>2013-07-25 10:27:51 -0400
committerTomas Sedovic <tomas@sedovic.cz>2013-08-01 16:18:57 +0200
commita68cb66802bc591a3b15143b680b9e08bf6e4fc7 (patch)
treea70e80766c28200d46e04473c21a3795106b210a
parentb83fdf3f130ad6b8c8ccce15452c9ae1197ba171 (diff)
downloadtuskar-ui-a68cb66802bc591a3b15143b680b9e08bf6e4fc7.tar.gz
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
-rw-r--r--openstack_dashboard/api/tuskar.py10
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/templates/resource_management/flavors/create.html2
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/templates/resource_management/flavors/edit.html3
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 %}
+