Merge pull request #813 from bastelfreak/fixfact

make fact work on old nginx as well
This commit is contained in:
Matthew Haughton 2016-06-23 22:59:31 -04:00 committed by GitHub
commit 204512fa86

View file

@ -2,7 +2,7 @@ Facter.add(:nginx_version) do
setcode do setcode do
if Facter.value('kernel') != 'windows' && Facter::Util::Resolution.which('nginx') if Facter.value('kernel') != 'windows' && Facter::Util::Resolution.which('nginx')
nginx_version = Facter::Util::Resolution.exec('nginx -v 2>&1') nginx_version = Facter::Util::Resolution.exec('nginx -v 2>&1')
%r{^nginx version: nginx\/([\w\.]+)}.match(nginx_version)[1] %r{nginx version: nginx\/([\w\.]+)}.match(nginx_version)[1]
end end
end end
end end