mirror of https://github.com/apache/cloudstack.git
Resource tags: CS-15591 - delete tags for template/iso when corresponding vo object is removed
This commit is contained in:
parent
8a3a788d72
commit
097c260690
|
|
@ -860,8 +860,10 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
|
|||
txn.start();
|
||||
VMTemplateVO template = createForUpdate();
|
||||
template.setRemoved(new Date());
|
||||
if (template != null) {
|
||||
if (template.getFormat() == ImageFormat.ISO) {
|
||||
|
||||
VMTemplateVO vo = findById(id);
|
||||
if (vo != null) {
|
||||
if (vo.getFormat() == ImageFormat.ISO) {
|
||||
_tagsDao.removeByIdAndType(id, TaggedResourceType.ISO);
|
||||
} else {
|
||||
_tagsDao.removeByIdAndType(id, TaggedResourceType.Template);
|
||||
|
|
|
|||
Loading…
Reference in New Issue