Skip to content

Instantly share code, notes, and snippets.

@x-yuri
Created December 27, 2014 17:26
Show Gist options
  • Save x-yuri/0ed2be547041c8518f16 to your computer and use it in GitHub Desktop.
Save x-yuri/0ed2be547041c8518f16 to your computer and use it in GitHub Desktop.
vagrant-1.7 patch (line breaks issue)
From 9d1834a3c98fcc5f413878bb1f3acd055b6fe90e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dou=C3=A9zan-Grard=20Guillaume?=
<[email protected]>
Date: Sat, 13 Dec 2014 21:08:31 +0100
Subject: [PATCH] Fix line breaks
---
plugins/guests/arch/cap/configure_networks.rb | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/plugins/guests/arch/cap/configure_networks.rb b/plugins/guests/arch/cap/configure_networks.rb
index 3d69fee..fd06c24 100644
--- a/plugins/guests/arch/cap/configure_networks.rb
+++ b/plugins/guests/arch/cap/configure_networks.rb
@@ -11,20 +11,14 @@ module VagrantPlugins
def self.configure_networks(machine, networks)
interfaces = Array.new
- machine.communicate.sudo("ip -o -0 addr | grep -v LOOPBACK | awk
- '{print $2}' | sed 's/://'") do |_, result|
+ machine.communicate.sudo("ip -o -0 addr | grep -v LOOPBACK | awk '{print $2}' | sed 's/://'") do |_, result|
interfaces = result.split("\n")
end
networks.each do |network|
- # We use :device in the template instead of
- # eth#{network[:interface]} in order to support Predictable
- # Network Interfaces
network[:device] = interfaces[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
@@ -32,10 +26,8 @@ module VagrantPlugins
temp.close
machine.communicate.upload(temp.path, "/tmp/vagrant_network")
- machine.communicate.sudo("mv /tmp/vagrant_network
- /etc/netctl/#{network[:device]}")
- machine.communicate.sudo("ip link set #{network[:device]} down &&
- netctl start #{network[:device]}")
+ machine.communicate.sudo("mv /tmp/vagrant_network /etc/netctl/#{network[:device]}")
+ machine.communicate.sudo("ip link set #{network[:device]} down && netctl start #{network[:device]}")
end
end
end
--
2.2.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment