Merge pull request #2158 from atomic-penguin/GH-1977

hosts/fedora: read as encoding
This commit is contained in:
Mitchell Hashimoto 2013-09-07 17:44:01 -07:00
commit 128d33e81d
2 changed files with 2 additions and 5 deletions

View File

@ -1,6 +1,3 @@
# Set the default encoding for Vagrant to UTF-8
Encoding.default_internal = Encoding::UTF_8
require 'log4r'
# Enable logging if it is requested. We do this before

View File

@ -11,7 +11,7 @@ module VagrantPlugins
release_file = Pathname.new("/etc/redhat-release")
if release_file.exist?
release_file.open("r") do |f|
release_file.open("r:ISO-8859-1:UTF-8") do |f|
contents = f.gets
return true if contents =~ /^Fedora/
return true if contents =~ /^CentOS/
@ -36,7 +36,7 @@ module VagrantPlugins
# proper NFS binary. This checks to see if we need to do that.
release_file = Pathname.new("/etc/redhat-release")
begin
release_file.open("r") do |f|
release_file.open("r:ISO-8859-1:UTF-8") do |f|
version_number = /(CentOS|Fedora|Red Hat Enterprise Linux Server).*release ([0-9]+)/.match(f.gets)[2].to_i
if version_number >= 16
# "service nfs-server" will redirect properly to systemctl