From f4a1a2ff380478fcd23319f0fd2678c50b971e36 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Thu, 6 Jun 2013 11:52:15 -0700 Subject: [PATCH] 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 --- .../com/cloud/network/NetworkManagerImpl.java | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java index b92ef4b7dfa..cae4e8a87a7 100755 --- a/server/src/com/cloud/network/NetworkManagerImpl.java +++ b/server/src/com/cloud/network/NetworkManagerImpl.java @@ -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 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");