canUseForDeploy is always false for system networks

This commit is contained in:
Alena Prokharchyk 2012-06-20 15:42:15 -07:00
parent c653b22d94
commit d2abc0e275
1 changed files with 4 additions and 0 deletions

View File

@ -2856,12 +2856,16 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
@Override
public boolean canUseForDeploy(Network network) {
if (network.getTrafficType() != TrafficType.Guest) {
return false;
}
boolean hasFreeIps = true;
if (network.getGuestType() == GuestType.Shared) {
hasFreeIps = _ipAddressDao.countFreeIPsInNetwork(network.getId()) > 0;
} else {
hasFreeIps = (getAvailableIps(network, null)).size() > 0;
}
return hasFreeIps;
}