1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-30 22:50:10 +03:00

bug #4550: add .iso extension to cdroms (vcenter)

This commit is contained in:
Javi Fontan 2016-06-13 18:27:26 +02:00
parent bbf7a98413
commit 73c7ab9f82

View File

@ -107,12 +107,19 @@ def vmdk_info(file)
end
case get_type(file_path).strip
when "application/octet-stream", "application/x-iso9660-image"
when "application/octet-stream"
return {
:type => :standalone,
:file => file_path,
:dir => File.dirname(file_path)
}
when "application/x-iso9660-image"
return {
:type => :standalone,
:file => file_path,
:dir => File.dirname(file_path),
:extension => '.iso'
}
when "text/plain"
info = {
:type => :flat,
@ -202,6 +209,7 @@ if is_remote?(file_path) || needs_unpack?(file_path)
end
info = vmdk_info(file_path)
extension = info[:extension] || ''
case info[:type]
when :standalone
@ -214,7 +222,8 @@ end
files_to_upload.each_with_index do |f, index|
path = "#{target_path}/#{File.basename(f)}"
if index == files_to_upload.size - 1
uploader_args = hostname + " " + ds_name + " " + path + " " + f
uploader_args = hostname + " " + ds_name + " " +
"#{path}#{extension}" + " " + f
else
uploader_args = hostname + " " + ds_name + " " +
path + " " + f + " &> /dev/null"