Merge pull request #8760 from marblenix/fix/Unable_to_list_network_interfaces_on_FreeBSD

Fix vagrant not being able to list network devices on some FreeBSD boxes.
This commit is contained in:
Brian Cain 2017-07-21 14:27:05 -07:00 committed by GitHub
commit 5ee3b0c3b9
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