Allow account to have multiple networks with customer defined cidrs as we already let it happen when the cidr is taken from the physical network config

This commit is contained in:
Alena Prokharchyk 2013-06-06 11:52:15 -07:00
parent 9a175f9306
commit f4a1a2ff38

View File

@ -1481,23 +1481,6 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
s_logger.debug("Found existing network configuration for offering " + offering + ": " + configs.get(0));
}
if (errorIfAlreadySetup) {
InvalidParameterValueException ex = new InvalidParameterValueException("Found existing network configuration (with specified id) for offering (with specified id)");
ex.addProxyObject(offering.getUuid(), "offeringId");
ex.addProxyObject(configs.get(0).getUuid(), "networkConfigId");
throw ex;
} else {
return configs;
}
}
} else if (predefined != null && predefined.getCidr() != null && predefined.getBroadcastUri() == null && vpcId == null) {
// don't allow to have 2 networks with the same cidr in the same zone for the account
List<NetworkVO> configs = _networksDao.listBy(owner.getId(), plan.getDataCenterId(), predefined.getCidr(), true);
if (configs.size() > 0) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Found existing network configuration for offering " + offering + ": " + configs.get(0));
}
if (errorIfAlreadySetup) {
InvalidParameterValueException ex = new InvalidParameterValueException("Found existing network configuration (with specified id) for offering (with specified id)");
ex.addProxyObject(offering.getUuid(), "offeringId");