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):
if detail:
d['ram'] = flavor.ram
d['disk'] = flavor.disk
d['cpu'] = flavor.cpu
return d
......
<?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>
......@@ -2,7 +2,7 @@
<?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">
{% 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>
{% endfor %}
</flavors>
......
......@@ -337,7 +337,7 @@ Array.prototype.unique = function () {
// get and configure flavor selection
function update_flavors() {
$.ajax({
url: '/api/v1.0/flavors/detail',
url: API_URL + '/flavors/detail',
type: "GET",
//async: false,
dataType: "json",
......@@ -350,7 +350,7 @@ function update_flavors() {
}
},
success: function(data, textStatus, jqXHR) {
flavors = data.flavors;
flavors = data.flavors.values;
$.each(flavors, function(i, flavor) {
cpus[i] = flavor['cpu'];
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