From d862133038f7909368833be4926cb2d2fddef680 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Mon, 6 Mar 2017 14:18:26 -0800 Subject: [PATCH] Remove hardcoded interface name from template --- templates/guests/debian/network_dhcp.erb | 4 ++-- test/unit/templates/guests/debian/network_dhcp_test.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/guests/debian/network_dhcp.erb b/templates/guests/debian/network_dhcp.erb index 6c305270a..fb3d47b54 100644 --- a/templates/guests/debian/network_dhcp.erb +++ b/templates/guests/debian/network_dhcp.erb @@ -6,8 +6,8 @@ iface <%= options[:device] %> inet dhcp post-up route del default dev $IFACE || true <% else %> # We need to disable eth0, see GH-2648 - post-up route del default dev eth0 || true + post-up route del default dev $IFACE || true post-up dhclient $IFACE - pre-down route add default dev eth0 + pre-down route add default dev $IFACE <% end %> #VAGRANT-END diff --git a/test/unit/templates/guests/debian/network_dhcp_test.rb b/test/unit/templates/guests/debian/network_dhcp_test.rb index e239d2eea..f30bbd950 100644 --- a/test/unit/templates/guests/debian/network_dhcp_test.rb +++ b/test/unit/templates/guests/debian/network_dhcp_test.rb @@ -31,9 +31,9 @@ describe "templates/guests/debian/network_dhcp" do auto eth1 iface eth1 inet dhcp # We need to disable eth0, see GH-2648 - post-up route del default dev eth0 || true + post-up route del default dev $IFACE || true post-up dhclient $IFACE - pre-down route add default dev eth0 + pre-down route add default dev $IFACE #VAGRANT-END EOH end