1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

Feature #565: Fix bugs in the template support.

This commit is contained in:
Hector Sanjuan 2011-04-12 15:32:15 +02:00 committed by Ruben S. Montero
parent 9b63d5c3ac
commit fbbb83fbb5
3 changed files with 12 additions and 5 deletions

View File

@ -21,7 +21,7 @@ module OpenNebulaJSON
class VirtualMachinePoolJSON < OpenNebula::VirtualMachinePool; include JSONUtils; end
class VirtualNetworkPoolJSON < OpenNebula::VirtualNetworkPool; include JSONUtils; end
class ImagePoolJSON < OpenNebula::ImagePool; include JSONUtils; end
class TemplatePoolJSON < OpenNebula::ImagePool; include JSONUtils; end
class TemplatePoolJSON < OpenNebula::TemplatePool; include JSONUtils; end
class ClusterPoolJSON < OpenNebula::ClusterPool; include JSONUtils; end
class UserPoolJSON < OpenNebula::UserPool; include JSONUtils; end
end

View File

@ -17,7 +17,7 @@
require 'OpenNebulaJSON/JSONUtils'
module OpenNebulaJSON
class TemplateJSON < OpenNebula::VirtualMachine
class TemplateJSON < OpenNebula::Template
include JSONUtils
def create(template_json)

View File

@ -142,7 +142,14 @@ var OpenNebula = {
{
return Error('Incorrect Pool');
}
//HACK!!!
if (pool_name == "TEMPLATE_POOL")
{
type = "VMTEMPLATE";
}
var p_pool = [];
if (response[pool_name]) {
@ -1934,7 +1941,7 @@ var OpenNebula = {
},
"Template" : {
"resource" : "TEMPLATE",
"resource" : "VMTEMPLATE",
"create" : function(params)
{
@ -2157,7 +2164,7 @@ var OpenNebula = {
{
if (callback)
{
var template_pool = OpenNebula.Helper.pool(resource,response);
var template_pool = OpenNebula.Helper.pool("TEMPLATE",response);
callback(request, template_pool);
}
},