Fix grep command for network interface of CoreOS guest
This commit is contained in:
parent
1f565b8f27
commit
982534aaed
|
@ -12,7 +12,7 @@ module VagrantPlugins
|
||||||
machine.communicate.tap do |comm|
|
machine.communicate.tap do |comm|
|
||||||
# Read network interface names
|
# Read network interface names
|
||||||
interfaces = []
|
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")
|
interfaces = result.split("\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ describe "VagrantPlugins::GuestCoreOS::Cap::ConfigureNetworks" do
|
||||||
|
|
||||||
allow(described_class).to receive(:get_ip).and_return("1.2.3.4")
|
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")
|
stdout: "eth1\neth2")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue