mirror of https://github.com/apache/cloudstack.git
bug 6499: If there is volume created from this template, this template can't be delete from secondary storage, it can be removed from DB
status 6499: resolved fixed
This commit is contained in:
parent
b0a3f329a0
commit
3dd7ed7fc6
|
|
@ -633,6 +633,9 @@ public class TemplateManagerImpl implements TemplateManager {
|
|||
|
||||
// Check if there are any snapshots for the template in the template host ref's zone
|
||||
List<VolumeVO> volumes = _volumeDao.findByTemplateAndZone(templateId, zoneId);
|
||||
if( volumes.size() > 0 ) {
|
||||
return false;
|
||||
}
|
||||
for (VolumeVO volume : volumes) {
|
||||
List<SnapshotVO> snapshots = _snapshotDao.listByVolumeId(volume.getId());
|
||||
if (!snapshots.isEmpty()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue