mirror of https://github.com/apache/cloudstack.git
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:
parent
9971120897
commit
8cbf5f749f
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue