Merge pull request #6139 from tjanez/fedora-no-biosdevname

Fixes Fedora network issues when biosdevname command is not present.
This commit is contained in:
Seth Vargo 2015-10-12 13:15:03 -04:00
commit ac05ce2431
1 changed files with 4 additions and 1 deletions

View File

@ -17,7 +17,10 @@ module VagrantPlugins
virtual = false
interface_names = Array.new
interface_names_by_slot = Array.new
machine.communicate.sudo("/usr/sbin/biosdevname; echo $?") do |_, result|
machine.communicate.sudo("/usr/sbin/biosdevname &>/dev/null; echo $?") do |_, result|
# The above command returns:
# - '4' if /usr/sbin/biosdevname detects it is running in a virtual machine
# - '127' if /usr/sbin/biosdevname doesn't exist
virtual = true if ['4', '127'].include? result.chomp
end