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

B #-: Fix s3 import (#1001)

Use exit_status of downloader.sh instead STDERR

downloader.sh returns
"Exporting image: 100% complete...done." to STDERR
for small rbd image, even if exits with 0
This commit is contained in:
Jan Orel 2021-03-19 23:27:12 +01:00 committed by GitHub
parent 41ae39e41e
commit 6ffc05d107
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,13 +115,14 @@ end
cmd = "#{UTILS_PATH}/downloader.sh #{import_source} -"
Open3.popen3(cmd) do |_, o, e, _|
Open3.popen3(cmd) do |_, o, e, wt|
body = o.read(read_length)
if o.eof?
exit_status = wt.value
error = Thread.new { e.read }.value
unless error.empty?
unless exit_status.success?
STDERR.puts error
exit 1
end