mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Handle ssh password prompts like "someone's password:" (closes #3290)
git-svn-id: http://svn.rubyonrails.org/rails/tools/switchtower@3375 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
07be3ab5d5
commit
162bb9f804
3 changed files with 9 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Handle ssh password prompts like "someone's password:"
|
||||
|
||||
* Make CLI#echo available as a class method.
|
||||
|
||||
* Add CLI#with_echo.
|
||||
|
|
|
@ -93,7 +93,7 @@ module SwitchTower
|
|||
Proc.new do |ch, stream, out|
|
||||
prefix = "#{stream} :: #{ch[:host]}"
|
||||
actor.logger.info out, prefix
|
||||
if out =~ /^Password.*:/
|
||||
if out =~ /\bpassword.*:/i
|
||||
actor.logger.info "subversion is asking for a password", prefix
|
||||
ch.send_data "#{actor.password}\n"
|
||||
elsif out =~ %r{\(yes/no\)}
|
||||
|
|
|
@ -113,4 +113,10 @@ MSG
|
|||
assert_nothing_raised { @scm.checkout(@actor) }
|
||||
assert_equal ["chocolatebrownies\n"], @actor.channels.last.sent_data
|
||||
end
|
||||
|
||||
def test_checkout_needs_alternative_ssh_password
|
||||
@actor.story = [[:out, "someone's password: "]]
|
||||
assert_nothing_raised { @scm.checkout(@actor) }
|
||||
assert_equal ["chocolatebrownies\n"], @actor.channels.last.sent_data
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue