From 8ad517c0280c00f9aca6b968d1e86848733d60a2 Mon Sep 17 00:00:00 2001 From: Min Chen Date: Wed, 8 May 2013 17:58:52 -0700 Subject: [PATCH] Append template unique name for S3 key for template sync. --- core/src/com/cloud/storage/template/DownloadManagerImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/com/cloud/storage/template/DownloadManagerImpl.java b/core/src/com/cloud/storage/template/DownloadManagerImpl.java index 7aea5ba1642..651dea1af46 100755 --- a/core/src/com/cloud/storage/template/DownloadManagerImpl.java +++ b/core/src/com/cloud/storage/template/DownloadManagerImpl.java @@ -491,6 +491,7 @@ public class DownloadManagerImpl extends ManagerBase implements DownloadManager throw new CloudRuntimeException("Unable to download from URL: " + url); } DownloadJob dj = new DownloadJob(td, jobId, id, name, format, hvm, accountId, descr, cksum, installPathPrefix, resourceType); + dj.setTmpltPath(installPathPrefix); jobs.put(jobId, dj); threadPool.execute(td); @@ -665,6 +666,9 @@ public class DownloadManagerImpl extends ManagerBase implements DownloadManager } else { installPathPrefix = resource.getRootDir(cmd) + File.separator + installPathPrefix; } + } else if (dstore instanceof S3TO ){ + // S3 key has template name inside to help template sync + installPathPrefix = installPathPrefix + File.separator + cmd.getName(); } String user = null; String password = null;