nfs: avoid adding extra newlines to /etc/exports

StringBlockEditor already adds the necessary newlines. That extra
newline was making /etc/exports longer and longer, full of empty lines,
because StringBlockEditor doesn't know about it and does not remove it.
This commit is contained in:
Antonio Terceiro 2019-11-17 00:27:06 -03:00 committed by Antonio Terceiro
parent 51ceda7e25
commit 4fd2373753
2 changed files with 2 additions and 2 deletions

View File

@ -77,7 +77,7 @@ module VagrantPlugins
sleep 0.5
nfs_cleanup("#{Process.uid} #{id}")
output = "#{nfs_exports_content}\n#{output}"
output = nfs_exports_content + output
nfs_write_exports(output)
if nfs_running?(nfs_check_command)

View File

@ -188,7 +188,7 @@ EOH
:linux__nfs_options=>["rw","all_squash"]}}
valid_id = SecureRandom.uuid
content =<<-EOH
\n# VAGRANT-BEGIN: #{Process.uid} #{valid_id}
# VAGRANT-BEGIN: #{Process.uid} #{valid_id}
"/home/vagrant" 127.0.0.1(rw,all_squash,anonuid=,anongid=,fsid=)
"/newhome/otherproject" 127.0.0.1(rw,all_squash,anonuid=,anongid=,fsid=)
# VAGRANT-END: #{Process.uid} #{valid_id}