From 4dd8b5d0615ceeeedf698c8bc23fc031ad841ab3 Mon Sep 17 00:00:00 2001 From: SudharmaJain Date: Fri, 1 Sep 2017 14:53:41 +0530 Subject: [PATCH] CLOUDSTACK-9563: ExtractTemplate returns malformed URL after migrating NFS to s3 (#1733) While downloading the template for the first time install path was not available. During first download after migration template is synced to s3 storage and template install path is updated to DB. But while generating the extract URL we are still taking install path from TemplateDataStoreVO object cached in the process. --- server/src/com/cloud/template/TemplateManagerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java index 1b7eb53e59c..86f687ce137 100644 --- a/server/src/com/cloud/template/TemplateManagerImpl.java +++ b/server/src/com/cloud/template/TemplateManagerImpl.java @@ -542,7 +542,7 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager, _tmpltSvr.syncTemplateToRegionStore(templateId, tmpltStore); TemplateInfo templateObject = _tmplFactory.getTemplate(templateId, tmpltStore); - String extractUrl = tmpltStore.createEntityExtractUrl(tmpltStoreRef.getInstallPath(), template.getFormat(), templateObject); + String extractUrl = tmpltStore.createEntityExtractUrl(templateObject.getInstallPath(), template.getFormat(), templateObject); tmpltStoreRef.setExtractUrl(extractUrl); tmpltStoreRef.setExtractUrlCreated(DateUtil.now()); _tmplStoreDao.update(tmpltStoreRef.getId(), tmpltStoreRef);