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

This commit is contained in:
edison 2014-01-08 15:04:05 -08:00
parent b88d3c6052
commit b3d4b72508
1 changed files with 5 additions and 0 deletions

View File

@ -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) {