Use semicolon over ampersand to separate commands
This commit is contained in:
parent
e8c6916ebc
commit
a1bb7b837a
|
@ -92,9 +92,9 @@ module VagrantPlugins
|
|||
interfaces.each do |iface|
|
||||
logger.debug("Restarting interface #{iface} on guest #{machine.name}")
|
||||
if nettools
|
||||
restart_command = "ifdown #{iface} && ifup #{iface}"
|
||||
restart_command = "ifdown #{iface};ifup #{iface}"
|
||||
else
|
||||
restart_command = "systemctl stop ifup@#{iface}.service && systemctl start ifup@#{iface}.service"
|
||||
restart_command = "systemctl stop ifup@#{iface}.service;systemctl start ifup@#{iface}.service"
|
||||
end
|
||||
comm.sudo(restart_command)
|
||||
end
|
||||
|
|
|
@ -136,18 +136,18 @@ describe "VagrantPlugins::GuestDebian::Cap::ChangeHostName" do
|
|||
|
||||
it "restarts every interface" do
|
||||
cap.send(:restart_each_interface, machine, logger)
|
||||
expect(comm.received_commands[0]).to match(/ifdown eth0 && ifup eth0/)
|
||||
expect(comm.received_commands[1]).to match(/ifdown eth1 && ifup eth1/)
|
||||
expect(comm.received_commands[2]).to match(/ifdown eth2 && ifup eth2/)
|
||||
expect(comm.received_commands[0]).to match(/ifdown eth0;ifup eth0/)
|
||||
expect(comm.received_commands[1]).to match(/ifdown eth1;ifup eth1/)
|
||||
expect(comm.received_commands[2]).to match(/ifdown eth2;ifup eth2/)
|
||||
end
|
||||
end
|
||||
|
||||
context "with systemctl" do
|
||||
it "restarts every interface" do
|
||||
cap.send(:restart_each_interface, machine, logger)
|
||||
expect(comm.received_commands[0]).to match(/systemctl stop ifup@eth0.service && systemctl start ifup@eth0.service/)
|
||||
expect(comm.received_commands[1]).to match(/systemctl stop ifup@eth1.service && systemctl start ifup@eth1.service/)
|
||||
expect(comm.received_commands[2]).to match(/systemctl stop ifup@eth2.service && systemctl start ifup@eth2.service/)
|
||||
expect(comm.received_commands[0]).to match(/systemctl stop ifup@eth0.service;systemctl start ifup@eth0.service/)
|
||||
expect(comm.received_commands[1]).to match(/systemctl stop ifup@eth1.service;systemctl start ifup@eth1.service/)
|
||||
expect(comm.received_commands[2]).to match(/systemctl stop ifup@eth2.service;systemctl start ifup@eth2.service/)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue