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