mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	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:
		
							parent
							
								
									9a175f9306
								
							
						
					
					
						commit
						f4a1a2ff38
					
				| @ -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"); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user