diff --git a/core/src/com/cloud/storage/template/DownloadManagerImpl.java b/core/src/com/cloud/storage/template/DownloadManagerImpl.java index 8d41e293e6a..3a69471fbb9 100644 --- a/core/src/com/cloud/storage/template/DownloadManagerImpl.java +++ b/core/src/com/cloud/storage/template/DownloadManagerImpl.java @@ -303,7 +303,7 @@ public class DownloadManagerImpl implements DownloadManager { } // add options common to ISO and template - String extension = dnld.getFormat().toString().toLowerCase(); + String extension = dnld.getFormat().getFileExtension(); String templateName = ""; if( extension.equals("iso")) { templateName = jobs.get(jobId).getTmpltName().trim().replace(" ", "_"); diff --git a/core/src/com/cloud/storage/template/VmdkProcessor.java b/core/src/com/cloud/storage/template/VmdkProcessor.java index fe060ab02de..d1e522196b1 100644 --- a/core/src/com/cloud/storage/template/VmdkProcessor.java +++ b/core/src/com/cloud/storage/template/VmdkProcessor.java @@ -26,7 +26,7 @@ public class VmdkProcessor implements Processor { } s_logger.info("Template processing. templatePath: " + templatePath + ", templateName: " + templateName); - String templateFilePath = templatePath + File.separator + templateName + ImageFormat.VMDK.getFileExtension(); + String templateFilePath = templatePath + File.separator + templateName + "." + ImageFormat.VMDK.getFileExtension(); if (!_storage.exists(templateFilePath)) { if(s_logger.isInfoEnabled()) s_logger.info("Unable to find the vmware template file: " + templateFilePath); @@ -35,7 +35,7 @@ public class VmdkProcessor implements Processor { FormatInfo info = new FormatInfo(); info.format = ImageFormat.VMDK; - info.filename = templateName + ImageFormat.VMDK.getFileExtension(); + info.filename = templateName + "." + ImageFormat.VMDK.getFileExtension(); info.size = _storage.getSize(templateFilePath); info.virtualSize = info.size; return info;