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/01/09 00:05:53 UTC

git commit: updated refs/heads/4.3 to b3d4b72

Updated Branches:
  refs/heads/4.3 b88d3c605 -> b3d4b7250


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/b3d4b725
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b3d4b725
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b3d4b725

Branch: refs/heads/4.3
Commit: b3d4b72508c82b0c07cca9dbab2a63599231be9d
Parents: b88d3c6
Author: edison <su...@gmail.com>
Authored: Wed Jan 8 15:04:05 2014 -0800
Committer: edison <su...@gmail.com>
Committed: Wed Jan 8 15:05:27 2014 -0800

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3d4b725/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 711aff0..c6bb617 100755
--- a/server/src/com/cloud/template/HypervisorTemplateAdapter.java
+++ b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
@@ -346,6 +346,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) {