Merge pull request #4297 from gildub/bug/fedora20+network
guests/fedora: Fixes Fedora 20 network issues when virtual
This commit is contained in:
commit
1cafc00bcb
|
@ -14,7 +14,21 @@ module VagrantPlugins
|
||||||
def self.configure_networks(machine, networks)
|
def self.configure_networks(machine, networks)
|
||||||
network_scripts_dir = machine.guest.capability("network_scripts_dir")
|
network_scripts_dir = machine.guest.capability("network_scripts_dir")
|
||||||
|
|
||||||
|
virtual = false
|
||||||
interface_names = Array.new
|
interface_names = Array.new
|
||||||
|
machine.communicate.sudo("/usr/sbin/biosdevname; echo $?") do |_, result|
|
||||||
|
virtual = true if result.chomp == '4'
|
||||||
|
end
|
||||||
|
|
||||||
|
if virtual
|
||||||
|
machine.communicate.sudo("ls /sys/class/net | grep -v lo") do |_, result|
|
||||||
|
interface_names = result.split("\n")
|
||||||
|
end
|
||||||
|
|
||||||
|
interface_names = networks.map do |network|
|
||||||
|
"eth#{network[:interface]}"
|
||||||
|
end
|
||||||
|
else
|
||||||
machine.communicate.sudo("/usr/sbin/biosdevname -d | grep Kernel | cut -f2 -d: | sed -e 's/ //;'") do |_, result|
|
machine.communicate.sudo("/usr/sbin/biosdevname -d | grep Kernel | cut -f2 -d: | sed -e 's/ //;'") do |_, result|
|
||||||
interface_names = result.split("\n")
|
interface_names = result.split("\n")
|
||||||
end
|
end
|
||||||
|
@ -35,6 +49,7 @@ module VagrantPlugins
|
||||||
interface_names.delete(interface_name)
|
interface_names.delete(interface_name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Accumulate the configurations to add to the interfaces file as well
|
# Accumulate the configurations to add to the interfaces file as well
|
||||||
# as what interfaces we're actually configuring since we use that later.
|
# as what interfaces we're actually configuring since we use that later.
|
||||||
|
|
Loading…
Reference in New Issue