From 3643181021fcd4b2ccb692480d26a99d7e84bf6d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 9 Jan 2011 13:12:57 -0800 Subject: [PATCH] Gentoo needs its own prepare_host_only_network method --- lib/vagrant/systems/gentoo.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/vagrant/systems/gentoo.rb b/lib/vagrant/systems/gentoo.rb index 7b3d73219..609bc83f5 100644 --- a/lib/vagrant/systems/gentoo.rb +++ b/lib/vagrant/systems/gentoo.rb @@ -1,6 +1,19 @@ module Vagrant module Systems class Gentoo < Linux + def prepare_host_only_network + # Remove any previous host only network additions to the + # interface file. + vm.ssh.execute do |ssh| + # Verify gentoo + # ssh.exec!("cat /etc/gentoo-release", :error_class => GentooError, :_key => :network_not_gentoo) + + # Clear out any previous entries + ssh.exec!("sudo sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/conf.d/net > /tmp/vagrant-network-interfaces") + ssh.exec!("sudo su -c 'cat /tmp/vagrant-network-interfaces > /etc/conf.d/net'") + end + end + def enable_host_only_network(net_options) entry = TemplateRenderer.render('network_entry_gentoo', :net_options => net_options) vm.ssh.upload!(StringIO.new(entry), "/tmp/vagrant-network-entry")