lib/chef/provisioning/transport/ssh.rb in chef-provisioning-1.0.1 vs lib/chef/provisioning/transport/ssh.rb in chef-provisioning-1.1.0
- old
+ new
@@ -88,10 +88,11 @@
Chef::Log.debug("Stdout was:\n#{stdout}") if stdout != '' && !options[:stream] && !options[:stream_stdout] && config[:log_level] != :debug
Chef::Log.info("Stderr was:\n#{stderr}") if stderr != '' && !options[:stream] && !options[:stream_stderr] && config[:log_level] != :debug
SSHResult.new(command, execute_options, stdout, stderr, exitstatus)
end
+ # TODO why does #read_file download it to the target host?
def read_file(path)
Chef::Log.debug("Reading file #{path} from #{username}@#{host}")
result = StringIO.new
download(path, result)
result.string
@@ -206,10 +207,10 @@
begin
execute("cp #{path} #{remote_tempfile}").error!
execute("chown #{username} #{remote_tempfile}").error!
do_download remote_tempfile, local_path
rescue => e
- Chef::Log.error "Unable to download #{path} to #{local_path} on #{username}@#{host} -- #{e}"
+ Chef::Log.error "Unable to download #{path} to #{remote_tempfile} on #{username}@#{host} -- #{e}"
nil
ensure
# Clean up afterwards
begin
execute("rm #{remote_tempfile}").error!