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
38e0c4b31a
commit
0fdf1a1d8a
|
|
@ -851,8 +851,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