You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2014/03/28 01:39:28 UTC

[19/28] git commit: updated refs/heads/4.4 to 392dc81

CLOUDSTACK-5607: Don't delete the template if its stored in other zones.


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

Branch: refs/heads/4.4
Commit: a3edd1ac72f0ca7389d58e47b7497f638e277c01
Parents: 5917b25
Author: edison <su...@gmail.com>
Authored: Wed Jan 8 15:04:05 2014 -0800
Committer: Edison Su <su...@gmail.com>
Committed: Thu Mar 27 17:38:40 2014 -0700

----------------------------------------------------------------------
 server/src/com/cloud/template/HypervisorTemplateAdapter.java | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a3edd1ac/server/src/com/cloud/template/HypervisorTemplateAdapter.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/HypervisorTemplateAdapter.java b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
index 9d52b39..51dedf7 100755
--- a/server/src/com/cloud/template/HypervisorTemplateAdapter.java
+++ b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
@@ -399,6 +399,11 @@ public class HypervisorTemplateAdapter extends TemplateAdapterBase {
             }
         }
         if (success) {
+            if ((imageStores.size() > 1) && (profile.getZoneId() != null)) {
+                //if template is stored in more than one image stores, and the zone id is not null, then don't delete other templates.
+                return success;
+            }
+
             // delete all cache entries for this template
             List<TemplateInfo> cacheTmpls = imageFactory.listTemplateOnCache(template.getId());
             for (TemplateInfo tmplOnCache : cacheTmpls) {