mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Use ImageFormat.getFileExtension instead of toString() to retrieve template file extension name
This commit is contained in:
parent
0e2df1fe42
commit
a3a503fecb
@ -303,7 +303,7 @@ public class DownloadManagerImpl implements DownloadManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add options common to ISO and template
|
// add options common to ISO and template
|
||||||
String extension = dnld.getFormat().toString().toLowerCase();
|
String extension = dnld.getFormat().getFileExtension();
|
||||||
String templateName = "";
|
String templateName = "";
|
||||||
if( extension.equals("iso")) {
|
if( extension.equals("iso")) {
|
||||||
templateName = jobs.get(jobId).getTmpltName().trim().replace(" ", "_");
|
templateName = jobs.get(jobId).getTmpltName().trim().replace(" ", "_");
|
||||||
|
|||||||
@ -26,7 +26,7 @@ public class VmdkProcessor implements Processor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
s_logger.info("Template processing. templatePath: " + templatePath + ", templateName: " + templateName);
|
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 (!_storage.exists(templateFilePath)) {
|
||||||
if(s_logger.isInfoEnabled())
|
if(s_logger.isInfoEnabled())
|
||||||
s_logger.info("Unable to find the vmware template file: " + templateFilePath);
|
s_logger.info("Unable to find the vmware template file: " + templateFilePath);
|
||||||
@ -35,7 +35,7 @@ public class VmdkProcessor implements Processor {
|
|||||||
|
|
||||||
FormatInfo info = new FormatInfo();
|
FormatInfo info = new FormatInfo();
|
||||||
info.format = ImageFormat.VMDK;
|
info.format = ImageFormat.VMDK;
|
||||||
info.filename = templateName + ImageFormat.VMDK.getFileExtension();
|
info.filename = templateName + "." + ImageFormat.VMDK.getFileExtension();
|
||||||
info.size = _storage.getSize(templateFilePath);
|
info.size = _storage.getSize(templateFilePath);
|
||||||
info.virtualSize = info.size;
|
info.virtualSize = info.size;
|
||||||
return info;
|
return info;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user