From e28f8a1202bad2f915a63facf0530c291f9a6f36 Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Mon, 16 Apr 2018 19:04:36 +0200 Subject: [PATCH] F #1249: Add .vmdk mandatory extension --- src/datastore_mad/remotes/vcenter/cp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/datastore_mad/remotes/vcenter/cp b/src/datastore_mad/remotes/vcenter/cp index 53c8e94031..301f9faf1c 100755 --- a/src/datastore_mad/remotes/vcenter/cp +++ b/src/datastore_mad/remotes/vcenter/cp @@ -66,6 +66,10 @@ target_path = "#{ds_image_dir}/#{id}" if VCenterDriver::FileHelper.is_remote_or_needs_unpack?(img_path) temp_folder = File.join(VAR_LOCATION, "vcenter/#{target_path}") temp_file = File.join(temp_folder, File.basename(img_path)) + # if the original file doesn't have the .vmdk extension, add it + if !temp_file.match(/\.vmdk$/) + temp_file += ".vmdk" + end # Create tmp directory FileUtils.mkdir_p(temp_folder) @@ -153,4 +157,3 @@ files_to_upload.each_with_index do |f, index| end FileUtils.rm_rf(temp_file) if temp_file -