CLOUDSTACK-3462: NumberFormatException with TemplateService while performing template synchronization.

This commit is contained in:
Sanjay Tripathi 2013-07-11 13:44:32 +05:30 committed by Devdeep Singh
parent 5dda98c3a0
commit 4a9c665c19
1 changed files with 4 additions and 1 deletions

View File

@ -79,6 +79,7 @@ import com.cloud.storage.dao.VMTemplateZoneDao;
import com.cloud.storage.template.TemplateConstants;
import com.cloud.storage.template.TemplateProp;
import com.cloud.template.TemplateManager;
import com.cloud.user.Account;
import com.cloud.user.AccountManager;
import com.cloud.user.ResourceLimitService;
import com.cloud.utils.UriUtils;
@ -319,7 +320,9 @@ public class TemplateServiceImpl implements TemplateService {
tmlpt.setSize(tmpltInfo.getSize());
_templateDao.update(tmplt.getId(), tmlpt);
if (tmpltInfo.getSize() > 0 && tmplt.getUrl() != null) {
// Skipping limit checks for SYSTEM Account and for the templates created from volumes or snapshots
// which already got checked and incremented during createTemplate API call.
if (tmpltInfo.getSize() > 0 && tmplt.getAccountId() != Account.ACCOUNT_ID_SYSTEM && tmplt.getUrl() != null) {
long accountId = tmplt.getAccountId();
try {
_resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(accountId),