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 9971120897
commit 8cbf5f749f
1 changed files with 8 additions and 0 deletions

View File

@ -7068,6 +7068,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);
}