diff --git a/beaker.gemspec b/beaker.gemspec index 8873ea725e..23f699cecb 100644 --- a/beaker.gemspec +++ b/beaker.gemspec @@ -40,6 +40,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'rsync', '~> 1.0.9' s.add_runtime_dependency 'winrm', '~> 1.3.0' s.add_runtime_dependency 'winrm-fs', '~> 0.1.0' + s.add_runtime_dependency 'winrm-transport', '~> 1.0.0' # Optional provisioner specific support s.add_runtime_dependency 'rbvmomi', '~> 1.8' diff --git a/lib/beaker/winrm_connection.rb b/lib/beaker/winrm_connection.rb index 43cc41b0cb..487e511656 100644 --- a/lib/beaker/winrm_connection.rb +++ b/lib/beaker/winrm_connection.rb @@ -2,6 +2,7 @@ require 'timeout' require 'winrm' require 'winrm-fs' +require 'winrm/transport/file_transporter' module Beaker class WinrmConnection @@ -149,11 +150,10 @@ def scp_to source, target, options = {}, dry_run = false result = Result.new(@hostname, [source, target]) result.stdout = "\n" - file_manager = WinRM::FS::FileManager.new(@winrm) - file_manager.upload(source, target) do |bytes_copied, total_bytes, local_path, remote_path| - result.stdout << "\t#{bytes_copied}bytes of #{total_bytes}bytes copied\n" - end - + file_transporter = WinRM::Transport::FileTransporter.new(@winrm) + upload_results = file_transporter.upload(source, target) + stats = upload_results.first[1] + result.stdout << " #{stats['xfered']} bytes uploaded in #{stats['chunks']} chunks\n" # Setting these values allows reporting via result.log(test_name) result.stdout << " Copied file #{source} to #{@hostname}:#{target}"