Merge pull request #9644 from chrisroberts/f-resolv-replace
Make resolv-replace loading optional not automatic
This commit is contained in:
commit
a5d22acdf7
|
@ -134,6 +134,7 @@ module Vagrant
|
||||||
#
|
#
|
||||||
# @return [boolean] enabled or not
|
# @return [boolean] enabled or not
|
||||||
def self.enable_resolv_replace
|
def self.enable_resolv_replace
|
||||||
|
if ENV["VAGRANT_ENABLE_RESOLV_REPLACE"]
|
||||||
if !ENV["VAGRANT_DISABLE_RESOLV_REPLACE"]
|
if !ENV["VAGRANT_DISABLE_RESOLV_REPLACE"]
|
||||||
begin
|
begin
|
||||||
require "resolv-replace"
|
require "resolv-replace"
|
||||||
|
@ -146,3 +147,4 @@ module Vagrant
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -143,4 +143,23 @@ describe Vagrant do
|
||||||
expect(subject.prerelease?).to be(false)
|
expect(subject.prerelease?).to be(false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#enable_resolv_replace" do
|
||||||
|
it "should not attempt to require resolv-replace by default" do
|
||||||
|
expect(subject).not_to receive(:require).with("resolv-replace")
|
||||||
|
subject.enable_resolv_replace
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should require resolv-replace when VAGRANT_ENABLE_RESOLV_REPLACE is set" do
|
||||||
|
expect(subject).to receive(:require).with("resolv-replace")
|
||||||
|
with_temp_env("VAGRANT_ENABLE_RESOLV_REPLACE" => "1"){ subject.enable_resolv_replace }
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should not require resolv-replace when VAGRANT_DISABLE_RESOLV_REPLACE is set" do
|
||||||
|
expect(subject).not_to receive(:require).with("resolv-replace")
|
||||||
|
with_temp_env("VAGRANT_ENABLE_RESOLV_REPLACE" => "1", "VAGRANT_DISABLE_RESOLV_REPLACE" => "1") do
|
||||||
|
subject.enable_resolv_replace
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -219,8 +219,11 @@ shared folders. Defaults to true if the option is not set. This can be overridde
|
||||||
on a per-folder basis within your Vagrantfile config by settings the
|
on a per-folder basis within your Vagrantfile config by settings the
|
||||||
`SharedFoldersEnableSymlinksCreate` option to true.
|
`SharedFoldersEnableSymlinksCreate` option to true.
|
||||||
|
|
||||||
|
## `VAGRANT_ENABLE_RESOLV_REPLACE`
|
||||||
|
|
||||||
|
Use the Ruby Resolv library in place of the libc resolver.
|
||||||
|
|
||||||
## `VAGRANT_DISABLE_RESOLV_REPLACE`
|
## `VAGRANT_DISABLE_RESOLV_REPLACE`
|
||||||
|
|
||||||
Vagrant will automatically load `resolv-replace` to use Ruby's Resolv library
|
Vagrant can optionally use the Ruby Resolv library in place of the libc resolver.
|
||||||
in place of the libc resolver. This behavior can be disabled by setting this
|
This can be disabled setting this environment variable.
|
||||||
environment variable.
|
|
||||||
|
|
Loading…
Reference in New Issue