VPC: Don't allow to do ip assoc to the network in the VPC. The ip should be assigned to the VPC itself

This commit is contained in:
Alena Prokharchyk 2012-06-25 13:19:00 -07:00
parent b770c8b979
commit 83ed35f06b
1 changed files with 8 additions and 0 deletions

View File

@ -7066,6 +7066,14 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
}
if (networkId != null) {
Network network = _networksDao.findById(networkId);
if (network == null) {
throw new InvalidParameterValueException("Invalid network id is given");
}
if (network.getVpcId() != null) {
throw new InvalidParameterValueException("Specify vpcId to associate ip address to VPC");
}
return associateIPToGuestNetwork(ipId, networkId);
}