Basic fixes to the configure_networks for Arch

This commit is contained in:
Mitchell Hashimoto 2012-06-01 14:26:34 +02:00
parent f6c33fb4ef
commit da98ce59b3
2 changed files with 5 additions and 5 deletions

View File

@ -29,6 +29,7 @@
- Files that are included with `vagrant package --include` now properly
preserve file attributes on earlier versions of Ruby. [GH-951]
- SSH uses LogLevel FATAL so that errors are still shown.
- Multiple interfaces now work with Arch linux guests. [GH-957]
## 1.0.3 (May 1, 2012)

View File

@ -23,17 +23,16 @@ module VagrantPlugins
def configure_networks(networks)
networks.each do |network|
interfaces.add(network[:interface])
entry = TemplateRenderer.render("guests/arch/network_#{network[:type]}", :options => network)
entry = TemplateRenderer.render("guests/arch/network_#{network[:type]}",
:options => network)
temp = Tempfile.new("vagrant")
temp.binmode
temp.write(entry)
temp.close
vm.channel.upload(temp.path, temp.path)
vm.channel.sudo("mv #{temp.path} /etc/network.d/interfaces/eth#{network[:interface]}")
vm.channel.upload(temp.path, "/tmp/vagrant_network")
vm.channel.sudo("mv /tmp/vagrant_network /etc/network.d/interfaces/eth#{network[:interface]}")
vm.channel.sudo("netcfg interfaces/eth#{network[:interface]}")
end
end