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

F #4532: Fix data nics template (#4563)

Signed-off-by: Jorge Lobo <jlobo@opennebula.systems>
This commit is contained in:
Jorge Lobo 2020-04-20 17:46:25 +02:00 committed by GitHub
parent 3ab22696e4
commit 929baad023
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,6 +72,10 @@ define(function(require) {
nics = [template_nic];
}
nics.map(function(nic){
nic.FROM = 'TEMPLATE';
})
var pcis = [];
if ($.isArray(template_json.VMTEMPLATE.TEMPLATE.PCI)){
@ -172,13 +176,21 @@ define(function(require) {
if (val == undefined || val == ""){
if (nic["NETWORK"] == undefined && nic["NETWORK_ID"] == undefined ){
// No network name or id in original NIC, and no selection done
return true; //continue
delete nic['FROM'];
return; //continue
}
}else{
if(nic && nic.FROM && nic.FROM==='TEMPLATE'){
delete nic['FROM'];
nics.push(nic);
return; //continue
}
}
delete nic["NETWORK"];
delete nic["NETWORK_ID"];
delete nic["NETWORK_UNAME"];
delete nic["NETWORK_UID"];
delete nic["FROM"];
nic["NETWORK_ID"] = val;
delete nic["FLOATING_IP"];
if ($("input.floating_ip", $(this)).prop("checked")){