mirror of https://github.com/apache/cloudstack.git
bug 10751: don't remove already removed templates during the account cleanup
status 10751: resolved fixed
This commit is contained in:
parent
b93318cb73
commit
3c0396bb20
|
|
@ -1069,11 +1069,13 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
|
|||
List<VMTemplateVO> userTemplates = _templateDao.listByAccountId(accountId);
|
||||
boolean allTemplatesDeleted = true;
|
||||
for (VMTemplateVO template : userTemplates) {
|
||||
try {
|
||||
allTemplatesDeleted = _tmpltMgr.delete(callerUserId, template.getId(), null);
|
||||
} catch (Exception e) {
|
||||
s_logger.warn("Failed to delete template while removing account: " + template.getName() + " due to: ", e);
|
||||
allTemplatesDeleted = false;
|
||||
if (template.getRemoved() == null) {
|
||||
try {
|
||||
allTemplatesDeleted = _tmpltMgr.delete(callerUserId, template.getId(), null);
|
||||
} catch (Exception e) {
|
||||
s_logger.warn("Failed to delete template while removing account: " + template.getName() + " due to: ", e);
|
||||
allTemplatesDeleted = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue