From 2aceb03b197a1da628b797c62842ddfe583efc68 Mon Sep 17 00:00:00 2001 From: Caleb Marble Date: Fri, 7 Jul 2017 09:03:38 -0500 Subject: [PATCH] Fix vagrant not being able to list network devices on FreeBSD boxes. --- plugins/guests/freebsd/cap/configure_networks.rb | 2 +- test/unit/plugins/guests/freebsd/cap/configure_networks_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/guests/freebsd/cap/configure_networks.rb b/plugins/guests/freebsd/cap/configure_networks.rb index 8e5627b5e..f496b942a 100644 --- a/plugins/guests/freebsd/cap/configure_networks.rb +++ b/plugins/guests/freebsd/cap/configure_networks.rb @@ -18,7 +18,7 @@ module VagrantPlugins # Remove any previous network additions to the configuration file. 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") end diff --git a/test/unit/plugins/guests/freebsd/cap/configure_networks_test.rb b/test/unit/plugins/guests/freebsd/cap/configure_networks_test.rb index 20b4cab61..0d2be59b3 100644 --- a/test/unit/plugins/guests/freebsd/cap/configure_networks_test.rb +++ b/test/unit/plugins/guests/freebsd/cap/configure_networks_test.rb @@ -13,7 +13,7 @@ describe "VagrantPlugins::GuestFreeBSD::Cap::ConfigureNetworks" do before do 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") end