diff --git a/plugins/guests/coreos/cap/configure_networks.rb b/plugins/guests/coreos/cap/configure_networks.rb index 827c8f075..fcff79da2 100644 --- a/plugins/guests/coreos/cap/configure_networks.rb +++ b/plugins/guests/coreos/cap/configure_networks.rb @@ -12,7 +12,7 @@ module VagrantPlugins machine.communicate.tap do |comm| # Read network interface names interfaces = [] - comm.sudo("ifconfig | grep '(e[n,t][h,s,p][[:digit:]]([a-z][[:digit:]])?' | cut -f1 -d:") do |_, result| + comm.sudo("ifconfig | grep -E '(e[n,t][h,s,p][[:digit:]]([a-z][[:digit:]])?)' | cut -f1 -d:") do |_, result| interfaces = result.split("\n") end diff --git a/test/unit/plugins/guests/coreos/cap/configure_networks_test.rb b/test/unit/plugins/guests/coreos/cap/configure_networks_test.rb index 28409ea6f..e8262d45c 100644 --- a/test/unit/plugins/guests/coreos/cap/configure_networks_test.rb +++ b/test/unit/plugins/guests/coreos/cap/configure_networks_test.rb @@ -21,7 +21,7 @@ describe "VagrantPlugins::GuestCoreOS::Cap::ConfigureNetworks" do allow(described_class).to receive(:get_ip).and_return("1.2.3.4") - comm.stub_command("ifconfig | grep '(e[n,t][h,s,p][[:digit:]]([a-z][[:digit:]])?' | cut -f1 -d:", + comm.stub_command("ifconfig | grep -E '(e[n,t][h,s,p][[:digit:]]([a-z][[:digit:]])?)' | cut -f1 -d:", stdout: "eth1\neth2") end