synced_folders/rsync: warn if password auth

This commit is contained in:
Mitchell Hashimoto 2014-01-10 20:37:11 -08:00
parent bcbcc51f74
commit 7b2a0716f1
3 changed files with 15 additions and 1 deletions

View File

@ -28,6 +28,10 @@ module VagrantPlugins
def enable(machine, folders, opts) def enable(machine, folders, opts)
ssh_info = machine.ssh_info ssh_info = machine.ssh_info
if ssh_info[:private_key_path].empty? && ssh_info[:password]
machine.ui.warn(I18n.t("vagrant.rsync_ssh_password"))
end
folders.each do |id, folder_opts| folders.each do |id, folder_opts|
rsync_single(machine, ssh_info, folder_opts) rsync_single(machine, ssh_info, folder_opts)
end end

View File

@ -83,6 +83,14 @@ en:
rsync_folder: |- rsync_folder: |-
Rsyncing folder: %{hostpath} => %{guestpath} Rsyncing folder: %{hostpath} => %{guestpath}
rsync_folder_excludes: " - Exclude: %{excludes}" rsync_folder_excludes: " - Exclude: %{excludes}"
rsync_ssh_password: |-
The machine you're rsyncing folders to is configured to use
password-based authentication. Vagrant can't script rsync to automatically
enter this password, so you'll likely be prompted for a password
shortly.
If you don't want to have to do this, please enable automatic
key insertion using `config.ssh.insert_key`.
ssh_exec_password: |- ssh_exec_password: |-
The machine you're attempting to SSH into is configured to use The machine you're attempting to SSH into is configured to use
password-based authentication. Vagrant can't script entering the password-based authentication. Vagrant can't script entering the

View File

@ -40,7 +40,9 @@ describe VagrantPlugins::SyncedFolderRSync::SyncedFolder do
end end
describe "#enable" do describe "#enable" do
let(:ssh_info) { Object.new } let(:ssh_info) {{
private_key_path: [],
}}
before do before do
machine.stub(ssh_info: ssh_info) machine.stub(ssh_info: ssh_info)