From 5058f351b1733a1e50e2f5a7aaaf81d65fc51b55 Mon Sep 17 00:00:00 2001 From: "Michael G. Noll" Date: Wed, 28 Aug 2013 09:01:27 +0200 Subject: [PATCH] GH-2087: Detect RHEL (Red Hat Enterprise Linux Server) properly --- plugins/hosts/fedora/host.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/hosts/fedora/host.rb b/plugins/hosts/fedora/host.rb index 59f623d72..98d619cc2 100644 --- a/plugins/hosts/fedora/host.rb +++ b/plugins/hosts/fedora/host.rb @@ -15,6 +15,7 @@ module VagrantPlugins contents = f.gets return true if contents =~ /^Fedora/ return true if contents =~ /^CentOS/ + return true if contents =~ /^Red Hat Enterprise Linux Server/ end end @@ -36,7 +37,7 @@ module VagrantPlugins release_file = Pathname.new("/etc/redhat-release") begin release_file.open("r") do |f| - version_number = /(CentOS|Fedora).*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 # "service nfs-server" will redirect properly to systemctl # when "service nfs-server restart" is called.