Commit 491ba48a authored by Markos Gogoulos's avatar Markos Gogoulos
Browse files

fix flavors to use api 1.1redux

 * add cpu attribute returned on flavor(s) listing
 * use api 1.1redux on gui for flavors
parent 27a5fd29
...@@ -23,6 +23,7 @@ def flavor_to_dict(flavor, detail=True): ...@@ -23,6 +23,7 @@ def flavor_to_dict(flavor, detail=True):
if detail: if detail:
d['ram'] = flavor.ram d['ram'] = flavor.ram
d['disk'] = flavor.disk d['disk'] = flavor.disk
d['cpu'] = flavor.cpu
return d return d
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<flavor xmlns="http://docs.openstack.org/compute/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" id="{{ flavor.id }}" name="{{ flavor.name }}" ram="{{ flavor.ram }}" disk="{{ flavor.disk }}"> <flavor xmlns="http://docs.openstack.org/compute/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" id="{{ flavor.id }}" name="{{ flavor.name }}" ram="{{ flavor.ram }}" cpu="{{ flavor.cpu }}" disk="{{ flavor.disk }}">
</flavor> </flavor>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<flavors xmlns="http://docs.openstack.org/compute/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom"> <flavors xmlns="http://docs.openstack.org/compute/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom">
{% for flavor in flavors %} {% for flavor in flavors %}
<flavor id="{{ flavor.id}}" name="{{ flavor.name }}"{% if detail %} ram="{{ flavor.ram }}" disk="{{ flavor.disk }}"{% endif %}> <flavor id="{{ flavor.id}}" name="{{ flavor.name }}"{% if detail %} ram="{{ flavor.ram }}" cpu="{{ flavor.cpu }}" disk="{{ flavor.disk }}"{% endif %}>
</flavor> </flavor>
{% endfor %} {% endfor %}
</flavors> </flavors>
......
...@@ -337,7 +337,7 @@ Array.prototype.unique = function () { ...@@ -337,7 +337,7 @@ Array.prototype.unique = function () {
// get and configure flavor selection // get and configure flavor selection
function update_flavors() { function update_flavors() {
$.ajax({ $.ajax({
url: '/api/v1.0/flavors/detail', url: API_URL + '/flavors/detail',
type: "GET", type: "GET",
//async: false, //async: false,
dataType: "json", dataType: "json",
...@@ -350,7 +350,7 @@ function update_flavors() { ...@@ -350,7 +350,7 @@ function update_flavors() {
} }
}, },
success: function(data, textStatus, jqXHR) { success: function(data, textStatus, jqXHR) {
flavors = data.flavors; flavors = data.flavors.values;
$.each(flavors, function(i, flavor) { $.each(flavors, function(i, flavor) {
cpus[i] = flavor['cpu']; cpus[i] = flavor['cpu'];
disks[i] = flavor['disk']; disks[i] = flavor['disk'];
......
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 to comment