diff --git a/CHANGELOG.md b/CHANGELOG.md index a2bb9505c0b..e750bb7044e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ BUG FIXES: dots [GH-2610] - guests/freebsd: configuring networks in the guest works properly [GH-2620] + - guests/redhat: fix configure networks bringing down interfaces that + don't exist. [GH-2614] ## 1.4.0 (December 9, 2013) diff --git a/plugins/guests/redhat/cap/configure_networks.rb b/plugins/guests/redhat/cap/configure_networks.rb index 6cc3c06a861..27488184767 100644 --- a/plugins/guests/redhat/cap/configure_networks.rb +++ b/plugins/guests/redhat/cap/configure_networks.rb @@ -51,8 +51,12 @@ def self.configure_networks(machine, networks) # SSH never dies. interfaces.each do |interface| retryable(:on => Vagrant::Errors::VagrantError, :tries => 3, :sleep => 2) do - # The interface should already be down - machine.communicate.sudo("/sbin/ifdown eth#{interface} 2> /dev/null") + # The interface should already be down so this probably + # won't do anything, so we run it with error_check false.j + machine.communicate.sudo( + "/sbin/ifdown eth#{interface} 2> /dev/null", error_check: false) + + # Add the new interface and bring it up machine.communicate.sudo("cat /tmp/vagrant-network-entry_#{interface} >> #{network_scripts_dir}/ifcfg-eth#{interface}") machine.communicate.sudo("ARPCHECK=no /sbin/ifup eth#{interface} 2> /dev/null") end