Skip to content

Commit 7daabf6

Browse files
committed
CLOUDSTACK-6438: WIP: Add filtering to check against existing IPs
1 parent 0b03609 commit 7daabf6

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

‎ui/scripts/network.js‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3393,9 +3393,23 @@
33933393

33943394
$(nics).map(function (index, nic) {
33953395
if (nic.secondaryip) {
3396-
notExisting = true;
3396+
var targetIPs = $(nic.secondaryip).map(function (index, sip) {
3397+
return sip.ipaddress;
3398+
});
33973399

3398-
return false;
3400+
var lbIPs = $(itemData).map(function(index, item) { return item.itemIp; });
3401+
3402+
targetIPs.push(nic.ipaddress);
3403+
3404+
var matchingIPs = $.grep(targetIPs, function(item) {
3405+
return $.inArray(item, lbIPs) > -1;
3406+
});
3407+
3408+
if (targetIPs.length - matchingIPs.length) {
3409+
notExisting = true;
3410+
3411+
return false;
3412+
}
33993413
}
34003414
});
34013415
}

0 commit comments

Comments
 (0)