mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
* F #5461: Support empty attributes in merges in Sunstone * F #5461: Added SCHED_REQUIREMENTS instantiate VM
This commit is contained in:
parent
1fa28d4065
commit
4e8318296c
@ -107,6 +107,13 @@ module OpenNebulaJSON
|
||||
end
|
||||
|
||||
template = template_to_str(params['template'])
|
||||
|
||||
['NIC', 'SCHED_ACTION', 'SCHED_REQUIREMENTS', 'SCHED_DS_REQUIREMENTS'].each { |i|
|
||||
if params['template'][i] && params['template'][i].empty?
|
||||
template << "\n#{i} = []"
|
||||
end
|
||||
}
|
||||
|
||||
super(params['vm_name'], params['hold'], template, persistent)
|
||||
else
|
||||
super(params['vm_name'], params['hold'], "", persistent)
|
||||
|
@ -259,16 +259,22 @@ define(function(require) {
|
||||
var vmgroup = VMGroupSection.retrieve($(".vmgroupContext"+ template_id));
|
||||
if(vmgroup){
|
||||
$.extend(tmp_json, vmgroup);
|
||||
} else {
|
||||
tmp_json.VMGROUP = [];
|
||||
}
|
||||
|
||||
var sched = WizardFields.retrieveInput($("#SCHED_REQUIREMENTS" + template_id, context));
|
||||
if(sched){
|
||||
if (sched){
|
||||
tmp_json.SCHED_REQUIREMENTS = sched;
|
||||
} else {
|
||||
tmp_json.SCHED_REQUIREMENTS = [];
|
||||
}
|
||||
|
||||
var sched_ds = WizardFields.retrieveInput($("#SCHED_DS_REQUIREMENTS" + template_id, context));
|
||||
if(sched_ds){
|
||||
if (sched_ds){
|
||||
tmp_json.SCHED_DS_REQUIREMENTS = sched_ds;
|
||||
} else {
|
||||
tmp_json.SCHED_DS_REQUIREMENTS = [];
|
||||
}
|
||||
|
||||
var nics = [];
|
||||
@ -277,14 +283,12 @@ define(function(require) {
|
||||
$.each(networks, function(){
|
||||
if (this.TYPE == "NIC"){
|
||||
pcis.push(this);
|
||||
}else{
|
||||
} else {
|
||||
nics.push(this);
|
||||
}
|
||||
});
|
||||
|
||||
if (nics.length > 0) {
|
||||
tmp_json.NIC = nics;
|
||||
}
|
||||
tmp_json.NIC = nics;
|
||||
|
||||
// Replace PCIs of type nic only
|
||||
var original_tmpl = that.template_objects[index].VMTEMPLATE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user