guests/redhat: fix network configuration in CentOS 5

ip command is not on PATH by default in CentOS 5 so call it with the full path.
This commit is contained in:
Satoshi Matsumoto 2016-06-18 20:06:29 +09:00 committed by Seth Vargo
parent 01fd5c1dd1
commit de9abc8f72
No known key found for this signature in database
GPG Key ID: 905A90C2949E8787
2 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ module VagrantPlugins
interfaces = [] interfaces = []
commands = [] commands = []
comm.sudo("ip -o -0 addr | grep -v LOOPBACK | awk '{print $2}' | sed 's/://'") do |_, stdout| comm.sudo("/sbin/ip -o -0 addr | grep -v LOOPBACK | awk '{print $2}' | sed 's/://'") do |_, stdout|
interfaces = stdout.split("\n") interfaces = stdout.split("\n")
end end

View File

@ -12,7 +12,7 @@ describe "VagrantPlugins::GuestRedHat::Cap::ConfigureNetworks" do
before do before do
allow(machine).to receive(:communicate).and_return(comm) allow(machine).to receive(:communicate).and_return(comm)
comm.stub_command("ip -o -0 addr | grep -v LOOPBACK | awk '{print $2}' | sed 's/://'", comm.stub_command("/sbin/ip -o -0 addr | grep -v LOOPBACK | awk '{print $2}' | sed 's/://'",
stdout: "eth1\neth2") stdout: "eth1\neth2")
end end