mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
[4.6][BLOCKER]CLOUDSTACK-8763: Resolved POD/ZONE deletion failure.Instead of having both checkIfPodIsDeletable() and checkIfZoneIsDeletable have there own SQL query, I've refactored them so they use DAO SQL Queries. This resolves the SQL Exception thrown by both classes. Test to confirm working order: - deploy ACS - Add zones / pods. -> Try to delete without resources. -> Direct success. - Add resources to zones / pods. -> Try to delete with resources in the pod / zone. -> Correct exception thrown. (Error message is why it cannot remove the zone / pod. IE: There is still a hosts or vm or .... ) * pr/845: Added unit tests for checkIfPodIsDeletable() and checkIfZoneIsDeletable(). Updated Dao classes with correct field names. Refactored checkIfZoneIsDeletable(). Added findByDc(long dcId) to VolumeDao and VolumeDaoImpl. Added countIPs(long dcId, boolean onlyCountAllocated) to IPAddressDao and IPAddressDaoImpl. Added countIPs(long dcId, boolean onlyCountAllocated) to DataCenterIpAddressDao and DataCenterIpAddressDaoImpl. Refactored checkIfPodIsDeletable(). Added findByPodId(Long podId) to HostDao and HostDaoImpl. Signed-off-by: Wido den Hollander <wido@widodh.nl>