Merge pull request #10554 from iquiw/grep-fix-for-coreos

Fix grep command for network interface of CoreOS guest
This commit is contained in:
Brian Cain 2019-01-08 11:47:14 -08:00 committed by GitHub
commit 6b89324a9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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