CLOUDSTACK-6438: WIP: Add filtering to check against existing IPs

This commit is contained in:
Brian Federle 2014-05-01 15:07:25 -07:00
parent 1ad532f57e
commit 9885cf4fb0
1 changed files with 16 additions and 2 deletions

View File

@ -3393,9 +3393,23 @@
$(nics).map(function (index, nic) {
if (nic.secondaryip) {
notExisting = true;
var targetIPs = $(nic.secondaryip).map(function (index, sip) {
return sip.ipaddress;
});
return false;
var lbIPs = $(itemData).map(function(index, item) { return item.itemIp; });
targetIPs.push(nic.ipaddress);
var matchingIPs = $.grep(targetIPs, function(item) {
return $.inArray(item, lbIPs) > -1;
});
if (targetIPs.length - matchingIPs.length) {
notExisting = true;
return false;
}
}
});
}