Skip to content

Commit

Permalink
guests/redhat: don't ifdown non-existent interfaces [GH-2614]
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Dec 10, 2013
1 parent 4b191e1 commit 05b2e03
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 6 additions & 2 deletions plugins/guests/redhat/cap/configure_networks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 05b2e03

Please sign in to comment.