canUseForDeploy is always false for system networks

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

View File

@ -3218,12 +3218,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;
}