Hello,
I'm using capistrano-1.4.0. The following task fails on the "put"
line:
task :problem do
get "/home/user/remote-file", "/tmp/local-file"
put "some content", "/tmp/some-file-on-server"
end
As I learned from the code, the current implementation of Actor.get
closes the sftp connection; any subsequent put's will fail. I'm
suggesting the following fix:
-------------------------------------------
diff -Naur orig/actor.rb fix/actor.rb
--- orig/actor.rb 2007-02-14 19:02:47.000000000 +0200
+++ fix/actor.rb 2007-02-14 19:04:43.000000000 +0200
@@ -272,9 +272,9 @@
if Capistrano::SFTP && options.fetch(:sftp, true)
execute_on_servers(options.merge(:once => true)) do |servers|
logger.debug "downloading #{servers.first}:#{remote_path} to
#{path}"
- sessions[servers.first].sftp.connect do |tsftp|
- tsftp.get_file remote_path, path
- end
+ sftp = sessions[servers.first].sftp
+ sftp.connect unless sftp.state == :open
+ sftp.get_file remote_path, path
logger.trace "download finished"
end
else
-------------------------------------------
Thanks a lot,
dubek.
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---