mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-20 11:52:37 +09:00
feature #4184: Use template_raw in Template.update
Instead of using vmtemplate, use template_raw like the rest of resources
This commit is contained in:
1 parent
47c2bb5929
commit
8d0fa339a9
3 files changed
+4
-15
No files matched your search
@@ -70,14 +70,7 @@ module OpenNebulaJSON
|
||||
end
|
||||
|
||||
def update(params=Hash.new)
|
||||
template_hash = parse_json(params, 'vmtemplate')
|
||||
if template_hash['template_raw']
|
||||
template = template_hash['template_raw']
|
||||
else
|
||||
template = template_to_str(template_hash)
|
||||
end
|
||||
|
||||
super(template)
|
||||
super(params['template_raw'])
|
||||
end
|
||||
|
||||
def chown(params=Hash.new)
|
||||
|
||||
@@ -51,7 +51,7 @@ define(function(require) {
|
||||
OpenNebulaAction.simple_action(params, RESOURCE, "chmod_from_provision", action_obj);
|
||||
},
|
||||
"update" : function(params) {
|
||||
var action_obj = params.data.extra_param;
|
||||
var action_obj = {"template_raw" : params.data.extra_param};
|
||||
OpenNebulaAction.simple_action(params, RESOURCE, "update", action_obj);
|
||||
},
|
||||
"publish" : function(params) {
|
||||
|
||||
@@ -158,9 +158,7 @@ define(function(require) {
|
||||
{'vmtemplate': templateJSON});
|
||||
return false;
|
||||
} else if (this.action == "update") {
|
||||
Sunstone.runAction("Template.update",
|
||||
this.resourceId,
|
||||
JSON.stringify({'vmtemplate': templateJSON}));
|
||||
Sunstone.runAction("Template.update", this.resourceId, TemplateUtils.templateToString(templateJSON));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -173,9 +171,7 @@ define(function(require) {
|
||||
return false;
|
||||
|
||||
} else if (this.action == "update") {
|
||||
Sunstone.runAction("Template.update",
|
||||
this.resourceId,
|
||||
JSON.stringify({"vmtemplate": {"template_raw": template}}));
|
||||
Sunstone.runAction("Template.update", this.resourceId, template);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user