Merge pull request #1576 from smdahlen/fix-ssh-username

Fix use of config.ssh.username and reset provisioning path permissions.
This commit is contained in:
Mitchell Hashimoto 2013-04-11 08:11:24 -07:00
commit fef053e58e
2 changed files with 6 additions and 1 deletions

View File

@ -42,7 +42,7 @@ module VagrantPlugins
def chown_provisioning_folder
@machine.communicate.tap do |comm|
comm.sudo("mkdir -p #{@config.provisioning_path}")
comm.sudo("chown #{@machine.config.ssh.username} #{@config.provisioning_path}")
comm.sudo("chown -R #{@machine.ssh_info[:username]} #{@config.provisioning_path}")
end
end

View File

@ -12,6 +12,11 @@ module VagrantPlugins
with_script_file do |path|
# Upload the script to the machine
@machine.communicate.tap do |comm|
# Reset upload path permissions for the current ssh user
user = @machine.ssh_info[:username]
comm.sudo("chown -R #{user} #{config.upload_path}",
:error_check => false)
comm.upload(path.to_s, config.upload_path)
if config.path