Flush all log output and sleep a bit for NFS export warning [closes GH-119]
This commit is contained in:
parent
555b5af2a8
commit
14e7ff8d00
|
@ -23,7 +23,11 @@ module Vagrant
|
||||||
:ip => ip,
|
:ip => ip,
|
||||||
:folders => folders)
|
:folders => folders)
|
||||||
|
|
||||||
|
# The sleep ensures that the output is truly flushed before any `sudo`
|
||||||
|
# commands are issued.
|
||||||
env.logger.info "Preparing to edit /etc/exports. Administrator priveleges will be required..."
|
env.logger.info "Preparing to edit /etc/exports. Administrator priveleges will be required..."
|
||||||
|
sleep 0.5
|
||||||
|
|
||||||
output.split("\n").each do |line|
|
output.split("\n").each do |line|
|
||||||
# This should only ask for administrative permission once, even
|
# This should only ask for administrative permission once, even
|
||||||
# though its executed in multiple subshells.
|
# though its executed in multiple subshells.
|
||||||
|
|
|
@ -25,6 +25,8 @@ module Vagrant
|
||||||
:folders => folders)
|
:folders => folders)
|
||||||
|
|
||||||
env.logger.info "Preparing to edit /etc/exports. Administrator priveleges will be required..."
|
env.logger.info "Preparing to edit /etc/exports. Administrator priveleges will be required..."
|
||||||
|
sleep 0.5
|
||||||
|
|
||||||
output.split("\n").each do |line|
|
output.split("\n").each do |line|
|
||||||
# This should only ask for administrative permission once, even
|
# This should only ask for administrative permission once, even
|
||||||
# though its executed in multiple subshells.
|
# though its executed in multiple subshells.
|
||||||
|
|
|
@ -3,6 +3,17 @@ module Vagrant
|
||||||
# Subclass of the standard library logger which has no format on
|
# Subclass of the standard library logger which has no format on
|
||||||
# its own. The message sent to the logger is outputted as-is.
|
# its own. The message sent to the logger is outputted as-is.
|
||||||
class PlainLogger < ::Logger
|
class PlainLogger < ::Logger
|
||||||
|
# This is the method which is called for all debug, info, error,
|
||||||
|
# etc. methods by the logger. This is overriden to verify that
|
||||||
|
# the output is always flushed.
|
||||||
|
#
|
||||||
|
# Logger by default syncs all log devices but this just verifies
|
||||||
|
# it is truly flushed.
|
||||||
|
def add(*args)
|
||||||
|
super
|
||||||
|
@logdev.dev.flush if @logdev
|
||||||
|
end
|
||||||
|
|
||||||
def format_message(level, time, progname, msg)
|
def format_message(level, time, progname, msg)
|
||||||
# We do no formatting, its up to the user
|
# We do no formatting, its up to the user
|
||||||
"#{msg}\n"
|
"#{msg}\n"
|
||||||
|
|
Loading…
Reference in New Issue