Skip to content

Commit 5bfef62

Browse files
sudisonAnthony Xu
authored andcommitted
CLOUDSTACK-5607: Don't delete the template if its stored in other zones.
1 parent 8583b70 commit 5bfef62

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎server/src/com/cloud/template/HypervisorTemplateAdapter.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,11 @@ public boolean delete(TemplateProfile profile) {
399399
}
400400
}
401401
if (success) {
402+
if ((imageStores.size() > 1) && (profile.getZoneId() != null)) {
403+
//if template is stored in more than one image stores, and the zone id is not null, then don't delete other templates.
404+
return success;
405+
}
406+
402407
// delete all cache entries for this template
403408
List<TemplateInfo> cacheTmpls = imageFactory.listTemplateOnCache(template.getId());
404409
for (TemplateInfo tmplOnCache : cacheTmpls) {

0 commit comments

Comments
 (0)