diff --git a/src/sunstone/models/OpenNebulaJSON/PoolJSON.rb b/src/sunstone/models/OpenNebulaJSON/PoolJSON.rb index 578082bdbf..4ed254cbe6 100644 --- a/src/sunstone/models/OpenNebulaJSON/PoolJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/PoolJSON.rb @@ -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 diff --git a/src/sunstone/models/OpenNebulaJSON/TemplateJSON.rb b/src/sunstone/models/OpenNebulaJSON/TemplateJSON.rb index 9680ad2a8b..23801b915b 100644 --- a/src/sunstone/models/OpenNebulaJSON/TemplateJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/TemplateJSON.rb @@ -17,7 +17,7 @@ require 'OpenNebulaJSON/JSONUtils' module OpenNebulaJSON - class TemplateJSON < OpenNebula::VirtualMachine + class TemplateJSON < OpenNebula::Template include JSONUtils def create(template_json) diff --git a/src/sunstone/public/js/opennebula.js b/src/sunstone/public/js/opennebula.js index 656758f766..9895b8df32 100644 --- a/src/sunstone/public/js/opennebula.js +++ b/src/sunstone/public/js/opennebula.js @@ -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); } },