From a7355e03f1541a407396d4c3ab215f30674437e9 Mon Sep 17 00:00:00 2001 From: Aleksandar Kostadinov Date: Sat, 23 Jan 2021 02:35:30 +0200 Subject: [PATCH] avoid using curl when downloading ocm --- lib/launchers/o_c_m_cluster.rb | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/launchers/o_c_m_cluster.rb b/lib/launchers/o_c_m_cluster.rb index 67307732d2..0873904001 100644 --- a/lib/launchers/o_c_m_cluster.rb +++ b/lib/launchers/o_c_m_cluster.rb @@ -168,15 +168,14 @@ def download_ocm_cli raise "Unsupported OS" end end - #doesn't work - #File.open('/tmp/ocm', 'wb') do |file| - # @result = Http.get(url: url) do |chunk| - # file.write chunk - # end - #end - shell("curl -L #{url} -o /tmp/ocm") - File.chmod(0775, '/tmp/ocm') - return '/tmp/ocm' + ocm_path = File.join(Host.localhost.workdir, 'ocm') + File.open(ocm_path, 'wb') do |file| + @result = Http.get(url: url, raise_on_error: true) do |chunk| + file.write chunk + end + end + File.chmod(0775, ocm_path) + return ocm_path end def shell(cmd, output = nil)