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:
parent
bbf7a98413
commit
73c7ab9f82
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user