Skip to content

Commit

Permalink
Merge pull request #29 from tmatilai/tempfile
Browse files Browse the repository at this point in the history
The generated tempfile is sometimes deleted before uploading
  • Loading branch information
tmatilai committed Sep 27, 2013
2 parents 0d98d5f + 509fc08 commit 296540e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Compatibility with vagrant-aws v0.4.0 ([GH-28][])
* Next vagrant-aws release [will remove](https://github.com/mitchellh/vagrant-aws/commit/dd17f23) its custom TimedProvision action class
- Ensure that generated configuration files are not deleted before uploading ([GH-29][])

# 0.5.2 / 2013-09-27

Expand Down Expand Up @@ -75,3 +76,4 @@
[GH-26]: https://github.com/tmatilai/vagrant-proxyconf/issues/26 "Issue 26"
[GH-27]: https://github.com/tmatilai/vagrant-proxyconf/issues/27 "Issue 27"
[GH-28]: https://github.com/tmatilai/vagrant-proxyconf/issues/28 "Issue 28"
[GH-29]: https://github.com/tmatilai/vagrant-proxyconf/issues/29 "Issue 29"
3 changes: 2 additions & 1 deletion lib/vagrant-proxyconf/action/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@ def configure_machine(machine, config)
def write_config(machine, config, opts = {})
tmp = "/tmp/vagrant-proxyconf"
path = opts[:path] || config_path(machine)
local_tmp = tempfile(config)

logger.debug "Configuration (#{path}):\n#{config}"
machine.communicate.tap do |comm|
comm.upload(tempfile(config).path, tmp)
comm.upload(local_tmp.path, tmp)
comm.sudo("chmod #{opts[:mode] || '0644'} #{tmp}")
comm.sudo("chown #{opts[:owner] || 'root:root'} #{tmp}")
comm.sudo("mkdir -p #{File.dirname(path)}")
Expand Down

0 comments on commit 296540e

Please sign in to comment.