Skip to content

Commit

Permalink
B OpenNebula#2437: vCenter uploads files with proper names
Browse files Browse the repository at this point in the history
  • Loading branch information
sergio semedi committed Oct 3, 2018
1 parent caa8ed3 commit e0f7b4e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/datastore_mad/remotes/vcenter/cp
Expand Up @@ -71,6 +71,7 @@ end
temp_file = nil
filename = File.basename(img_path)
target_path = "#{ds_image_dir}/#{id}"
ext = File.extname(filename)

# If image is in a remote http location it has to be downloaded
# or if is a zipped file it has to be unzipped in a temp folder
Expand Down Expand Up @@ -151,8 +152,11 @@ files_to_upload.each_with_index do |f, index|
end

if is_last_file_to_upload?(index, files_to_upload)
uploader_args = ds_id + " " + ds_ref + " " +
"#{path}#{extension}" + " " + f
if ext == ""
uploader_args = ds_id + " " + ds_ref + " " + "#{path}#{extension}" + " " + f
else
uploader_args = ds_id + " " + ds_ref + " " + path + " " + f
end
else
uploader_args = ds_id + " " + ds_ref + " " +
path + " " + f + " &> /dev/null"
Expand Down

0 comments on commit e0f7b4e

Please sign in to comment.