Fix vagrant not being able to list network devices on FreeBSD boxes.

This commit is contained in:
Caleb Marble 2017-07-07 09:03:38 -05:00
parent c6e9a9a5b7
commit 2aceb03b19
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ module VagrantPlugins
# Remove any previous network additions to the configuration file. # Remove any previous network additions to the configuration file.
commands << "sed -i'' -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/rc.conf" commands << "sed -i'' -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/rc.conf"
comm.sudo("ifconfig -a | grep -o ^[0-9a-z]* | grep -v '^lo'", options) do |_, stdout| comm.sudo("ifconfig -a | grep -o '^[0-9a-z]*' | grep -v '^lo'", options) do |_, stdout|
interfaces = stdout.split("\n") interfaces = stdout.split("\n")
end end

View File

@ -13,7 +13,7 @@ describe "VagrantPlugins::GuestFreeBSD::Cap::ConfigureNetworks" do
before do before do
allow(machine).to receive(:communicate).and_return(comm) allow(machine).to receive(:communicate).and_return(comm)
comm.stub_command("ifconfig -a | grep -o ^[0-9a-z]* | grep -v '^lo'", comm.stub_command("ifconfig -a | grep -o '^[0-9a-z]*' | grep -v '^lo'",
stdout: "em1\nem2") stdout: "em1\nem2")
end end