Merge pull request #7460 from northerngit/master
Use ip instead of deprecated ifconfig for Red Hat/CentOS guests
This commit is contained in:
commit
1be664477d
|
@ -35,7 +35,7 @@ module VagrantPlugins
|
|||
interfaces = []
|
||||
commands = []
|
||||
|
||||
comm.sudo("ifconfig -a | grep -o ^[0-9a-z]* | grep -v '^lo'") do |_, stdout|
|
||||
comm.sudo("ip -o -0 addr | grep -v LOOPBACK | awk '{print $2}' | sed 's/://'") do |_, stdout|
|
||||
interfaces = stdout.split("\n")
|
||||
end
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ describe "VagrantPlugins::GuestRedHat::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("ip -o -0 addr | grep -v LOOPBACK | awk '{print $2}' | sed 's/://'",
|
||||
stdout: "eth1\neth2")
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue