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

bug #3363: rescue exception when trying to parse a plain service template

This commit is contained in:
Daniel Molina 2014-11-18 12:53:43 +01:00
parent 31f2f805fb
commit ab7b13b664

View File

@ -1390,7 +1390,12 @@ function initialize_create_service_template_dialog(dialog){
}).on('valid', function() {
if ($('#create_service_template_form_advanced',dialog).attr("action") == "create") {
var json_template = $("#template", this).val();
Sunstone.runAction("ServiceTemplate.create", JSON.parse(json_template) );
try {
Sunstone.runAction("ServiceTemplate.create", JSON.parse(json_template) );
} catch(e) {
popFormDialog("create_service_template_form", $("#oneflow-templates"));
notifyError(e);
}
return false;
} else if ($('#create_service_template_form_advanced',dialog).attr("action") == "update") {
var json_template = $("#template", this).val();