mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-11-04 00:02:37 +01:00 
			
		
		
		
	Bug 13085 - Traffic types of a deleted physical network should not be present in the "physical_network_traffic_types" table
Changes: - Added deleteTrafficTypes while deleting a physical network.
This commit is contained in:
		
							parent
							
								
									0f9f054bbf
								
							
						
					
					
						commit
						3a72de6d76
					
				@ -4513,6 +4513,10 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
 | 
			
		||||
 | 
			
		||||
        //delete service providers
 | 
			
		||||
        _pNSPDao.deleteProviders(physicalNetworkId);
 | 
			
		||||
        
 | 
			
		||||
        //delete traffic types
 | 
			
		||||
        _pNTrafficTypeDao.deleteTrafficTypes(physicalNetworkId);
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        boolean success = _physicalNetworkDao.remove(physicalNetworkId);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -28,4 +28,5 @@ public interface PhysicalNetworkTrafficTypeDao extends GenericDao<PhysicalNetwor
 | 
			
		||||
    boolean isTrafficTypeSupported(long physicalNetworkId, TrafficType trafficType);
 | 
			
		||||
    String getNetworkTag (long physicalNetworkId, TrafficType trafficType, HypervisorType hType);
 | 
			
		||||
    PhysicalNetworkTrafficTypeVO findBy(long physicalNetworkId, TrafficType trafficType);
 | 
			
		||||
    void deleteTrafficTypes(long physicalNetworkId);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -120,4 +120,11 @@ public class PhysicalNetworkTrafficTypeDaoImpl extends GenericDaoBase<PhysicalNe
 | 
			
		||||
        sc.setParameters("trafficType", trafficType);
 | 
			
		||||
        return findOneBy(sc);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void deleteTrafficTypes(long physicalNetworkId) {
 | 
			
		||||
        SearchCriteria<PhysicalNetworkTrafficTypeVO> sc = physicalNetworkSearch.create();
 | 
			
		||||
        sc.setParameters("physicalNetworkId", physicalNetworkId);
 | 
			
		||||
        remove(sc);        
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user