Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

guests/redhat: Don't error if ifdown fails [GH-2614] #2628

Merged
merged 1 commit into from
Dec 11, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions plugins/guests/redhat/cap/configure_networks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def self.configure_networks(machine, networks)
networks.each do |network|
interfaces.add(network[:interface])

# Down the interface before munging the config file
retryable(:on => Vagrant::Errors::VagrantError, :tries => 3, :sleep => 2) do
machine.communicate.sudo("/sbin/ifdown eth#{network[:interface]} 2> /dev/null")
end
# Down the interface before munging the config file. This might fail
# if the interface is not actually set up yet so ignore errors.
machine.communicate.sudo(
"/sbin/ifdown eth#{network[:interface]} 2> /dev/null", error_check: false)

# Remove any previous vagrant configuration in this network interface's
# configuration files.
Expand Down Expand Up @@ -52,7 +52,7 @@ def self.configure_networks(machine, networks)
interfaces.each do |interface|
retryable(:on => Vagrant::Errors::VagrantError, :tries => 3, :sleep => 2) do
# 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(
"/sbin/ifdown eth#{interface} 2> /dev/null", error_check: false)

Expand Down