Merge pull request #9394 from chrisroberts/u-resolv
Use Ruby's resolver by default and allow replace to be disabled
This commit is contained in:
commit
ba7a6c7f1d
|
@ -254,6 +254,12 @@ if I18n.config.respond_to?(:enforce_available_locales=)
|
|||
I18n.config.enforce_available_locales = true
|
||||
end
|
||||
|
||||
if Vagrant.enable_resolv_replace
|
||||
global_logger.info("resolv replacement has been enabled!")
|
||||
else
|
||||
global_logger.warn("resolv replacement has not been enabled!")
|
||||
end
|
||||
|
||||
# Setup the plugin manager and load any defined plugins
|
||||
require_relative "vagrant/plugin/manager"
|
||||
plugins = Vagrant::Plugin::Manager.instance.installed_plugins
|
||||
|
|
|
@ -129,4 +129,20 @@ module Vagrant
|
|||
true
|
||||
end
|
||||
end
|
||||
|
||||
# Use Ruby Resolv in place of libc
|
||||
#
|
||||
# @return [boolean] enabled or not
|
||||
def self.enable_resolv_replace
|
||||
if !ENV["VAGRANT_DISABLE_RESOLV_REPLACE"]
|
||||
begin
|
||||
require "resolv-replace"
|
||||
true
|
||||
rescue
|
||||
false
|
||||
end
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -218,3 +218,9 @@ If set, this will disable the ability to create symlinks with all virtualbox
|
|||
shared folders. Defaults to true if the option is not set. This can be overriden
|
||||
on a per-folder basis within your Vagrantfile config by settings the
|
||||
`SharedFoldersEnableSymlinksCreate` option to true.
|
||||
|
||||
## `VAGRANT_DISABLE_RESOLV_REPLACE`
|
||||
|
||||
Vagrant will automatically load `resolv-replace` to use Ruby's Resolv library
|
||||
in place of the libc resolver. This behavior can be disabled by setting this
|
||||
environment variable.
|
||||
|
|
Loading…
Reference in New Issue