Merge pull request #2158 from atomic-penguin/GH-1977
hosts/fedora: read as encoding
This commit is contained in:
commit
128d33e81d
|
@ -1,6 +1,3 @@
|
||||||
# Set the default encoding for Vagrant to UTF-8
|
|
||||||
Encoding.default_internal = Encoding::UTF_8
|
|
||||||
|
|
||||||
require 'log4r'
|
require 'log4r'
|
||||||
|
|
||||||
# Enable logging if it is requested. We do this before
|
# Enable logging if it is requested. We do this before
|
||||||
|
|
|
@ -11,7 +11,7 @@ module VagrantPlugins
|
||||||
release_file = Pathname.new("/etc/redhat-release")
|
release_file = Pathname.new("/etc/redhat-release")
|
||||||
|
|
||||||
if release_file.exist?
|
if release_file.exist?
|
||||||
release_file.open("r") do |f|
|
release_file.open("r:ISO-8859-1:UTF-8") do |f|
|
||||||
contents = f.gets
|
contents = f.gets
|
||||||
return true if contents =~ /^Fedora/
|
return true if contents =~ /^Fedora/
|
||||||
return true if contents =~ /^CentOS/
|
return true if contents =~ /^CentOS/
|
||||||
|
@ -36,7 +36,7 @@ module VagrantPlugins
|
||||||
# proper NFS binary. This checks to see if we need to do that.
|
# proper NFS binary. This checks to see if we need to do that.
|
||||||
release_file = Pathname.new("/etc/redhat-release")
|
release_file = Pathname.new("/etc/redhat-release")
|
||||||
begin
|
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
|
version_number = /(CentOS|Fedora|Red Hat Enterprise Linux Server).*release ([0-9]+)/.match(f.gets)[2].to_i
|
||||||
if version_number >= 16
|
if version_number >= 16
|
||||||
# "service nfs-server" will redirect properly to systemctl
|
# "service nfs-server" will redirect properly to systemctl
|
||||||
|
|
Loading…
Reference in New Issue