Fix grep command for network interface of CoreOS guest

This commit is contained in:
Iku Iwasa 2019-01-02 22:47:35 +09:00
parent 1f565b8f27
commit 982534aaed
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