Skip to content

Commit

Permalink
Merge pull request hashicorp#5954 from mitchellh/sethvargo/tmpdir
Browse files Browse the repository at this point in the history
Fallback to /tmp if $TMPDIR is not set
  • Loading branch information
mitchellh committed Jul 13, 2015
2 parents 7328f91 + bfbf96c commit 639f22c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/hosts/linux/cap/nfs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def self.nfs_cleanup(id)

# Use sed to just strip out the block of code which was inserted
# by Vagrant
system("cp /etc/exports $TMPDIR && #{sudo_command}sed -r -e '\\\x01^# VAGRANT-BEGIN:( #{user})? #{id}\x01,\\\x01^# VAGRANT-END:( #{user})? #{id}\x01 d' -ibak $TMPDIR/exports ; cp $TMPDIR/exports /etc/exports")
tmp = ENV["TMPDIR"] || ENV["TMP"] || "/tmp"
system("cp /etc/exports '#{tmp}' && #{sudo_command}sed -r -e '\\\x01^# VAGRANT-BEGIN:( #{user})? #{id}\x01,\\\x01^# VAGRANT-END:( #{user})? #{id}\x01 d' -ibak '#{tmp}/exports' ; cp '#{tmp}/exports' /etc/exports")
end

def self.nfs_opts_setup(folders)
Expand Down

0 comments on commit 639f22c

Please sign in to comment.