From 6ffc05d1076c56701a3f7c13b130c0066bdaa6f7 Mon Sep 17 00:00:00 2001 From: Jan Orel Date: Fri, 19 Mar 2021 23:27:12 +0100 Subject: [PATCH] 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 --- src/market_mad/remotes/s3/import | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/market_mad/remotes/s3/import b/src/market_mad/remotes/s3/import index 9a5aca32dd..61df4b00fe 100755 --- a/src/market_mad/remotes/s3/import +++ b/src/market_mad/remotes/s3/import @@ -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