incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [3/22] git commit: Resource tags: CS-15591 - delete tags for template/iso when corresponding vo object is removed
Date Mon, 16 Jul 2012 22:44:06 GMT
Resource tags: CS-15591 - delete tags for template/iso when corresponding vo object is removed


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/097c2606
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/097c2606
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/097c2606

Branch: refs/heads/vpc
Commit: 097c260690509d3d84cd6265699c2481fb18232d
Parents: 8a3a788
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Mon Jul 16 14:36:13 2012 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Mon Jul 16 15:43:06 2012 -0700

----------------------------------------------------------------------
 .../com/cloud/storage/dao/VMTemplateDaoImpl.java   |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/097c2606/server/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/dao/VMTemplateDaoImpl.java b/server/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
index 1db12aa..3c30076 100755
--- a/server/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
+++ b/server/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
@@ -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);


Mime
View raw message