diff --git a/src/datastore_mad/remotes/vcenter/cp b/src/datastore_mad/remotes/vcenter/cp index 0772ef678d..014d8697dd 100755 --- a/src/datastore_mad/remotes/vcenter/cp +++ b/src/datastore_mad/remotes/vcenter/cp @@ -173,7 +173,7 @@ files_to_upload.each_with_index do |f, index| cmd = "#{File.dirname(__FILE__)}/../vcenter_uploader.rb #{uploader_args}" target, stderr, status = Open3.capture3(cmd) - + if !status.success? STDERR.puts "Cannot upload file #{f}: #{stderr}" FileUtils.rm_rf(temp_file) if temp_file diff --git a/src/market_mad/remotes/s3/import b/src/market_mad/remotes/s3/import index a79f3aed56..e67b3adc42 100755 --- a/src/market_mad/remotes/s3/import +++ b/src/market_mad/remotes/s3/import @@ -111,10 +111,17 @@ end cmd = "#{UTILS_PATH}/downloader.sh #{import_source} -" -Open3.popen3(cmd) do |_, o, _, _| +Open3.popen3(cmd) do |_, o, e, _| body = o.read(read_length) if o.eof? + error = Thread.new { e.read }.value + + unless error.empty? + STDERR.puts error + exit 1 + end + s3.put_object(body) else s3.create_multipart_upload diff --git a/src/vmm_mad/remotes/lib/vcenter_driver/file_helper.rb b/src/vmm_mad/remotes/lib/vcenter_driver/file_helper.rb index 18063bb8b5..39e0b20e4d 100644 --- a/src/vmm_mad/remotes/lib/vcenter_driver/file_helper.rb +++ b/src/vmm_mad/remotes/lib/vcenter_driver/file_helper.rb @@ -197,7 +197,7 @@ module VCenterDriver .dirname( descriptor_url.host+descriptor_url.path ) - next unless ds.descriptor?(image_path + '/' + file_to_download) + next unless ds.is_descriptor?(image_path + '/' + file_to_download) files_to_download << download_all_filenames_in_descriptor( @@ -223,7 +223,7 @@ module VCenterDriver # related files, creates a tar.gz and dumps it in stdout def self.dump_vmdk_tar_gz(vcenter_url, ds) image_source = vcenter_url.host + vcenter_url.path - if ds.descriptor?(image_source) + if ds.is_descriptor?(image_source) files_to_download = get_all_filenames_in_descriptor( vcenter_url,