Merge pull request #2628 from makern/ifdown-fix

guests/redhat: Don't error if ifdown fails [GH-2614]
This commit is contained in:
Mitchell Hashimoto 2013-12-10 18:02:06 -08:00
commit 70b662e307
1 changed files with 5 additions and 5 deletions

View File

@ -21,10 +21,10 @@ module VagrantPlugins
networks.each do |network| networks.each do |network|
interfaces.add(network[:interface]) interfaces.add(network[:interface])
# Down the interface before munging the config file # Down the interface before munging the config file. This might fail
retryable(:on => Vagrant::Errors::VagrantError, :tries => 3, :sleep => 2) do # if the interface is not actually set up yet so ignore errors.
machine.communicate.sudo("/sbin/ifdown eth#{network[:interface]} 2> /dev/null") machine.communicate.sudo(
end "/sbin/ifdown eth#{network[:interface]} 2> /dev/null", error_check: false)
# Remove any previous vagrant configuration in this network interface's # Remove any previous vagrant configuration in this network interface's
# configuration files. # configuration files.
@ -52,7 +52,7 @@ module VagrantPlugins
interfaces.each do |interface| interfaces.each do |interface|
retryable(:on => Vagrant::Errors::VagrantError, :tries => 3, :sleep => 2) do retryable(:on => Vagrant::Errors::VagrantError, :tries => 3, :sleep => 2) do
# The interface should already be down so this probably # The interface should already be down so this probably
# won't do anything, so we run it with error_check false.j # won't do anything, so we run it with error_check false.
machine.communicate.sudo( machine.communicate.sudo(
"/sbin/ifdown eth#{interface} 2> /dev/null", error_check: false) "/sbin/ifdown eth#{interface} 2> /dev/null", error_check: false)