Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1 0 stable: Fix for issue #1036 #1039

Closed
wants to merge 10 commits into from

Conversation

mandarbarve
Copy link

Fix for issue #1036

When doing vagrant up on Windows 7 shell provisioner hangs when uploading a temporary file from local machine to the guest VM. File created in the temporary location on the host is not closed before yielding for upload to guest VM path. This appeared to be the reason for upload process hang as the data was transferred but SCP would still not complete which could be because the end of file character was not sent. I made a change in the shell.rb file under embedded\lib\ruby\gems\1.9.1\gems\vagrant-1.0.3\lib\vagrant\provisioners folder. With this change problem went away and I could deploy the guest VM successfully.

Clarification of the patch:

•Closed file explicitly before upload
--- C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/provisioners/shell.org.rb Tue May 01 23:27:42 2012
+++ C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/provisioners/shell.rb Fri Jul 13 12:08:49 2012
@@ -60,12 +60,13 @@

and handle it specially...

file = Tempfile.new('vagrant-shell')
begin
file.write(config.inline)
file.fsync

•file.close <<<<< Added code to close the file explicitly yield file.path
•ensure
•rescue <<<< Since the file is closed before yielding for upload, now closing and unlinking only for rescue file.close file.unlink end end

@hashicorp hashicorp locked and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants