Browse files

make sudoversion fact more robust

Depending on the locale of the system, 'sudo -V' doesn't output exactly
the same string. Since we're parsing that string using a regex, we need
to plan for these differences.
  • Loading branch information...
1 parent 450b6e9 commit 432d2b9e9ccf85d917210df750d0841c79e6bd60 @ckaenzig ckaenzig committed Sep 24, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/facter/sudo.rb
@@ -1,6 +1,6 @@
output = %x{sudo -V 2>&1}
-if $?.exitstatus and output.match(/Sudo version ([\d\.]+)/)
+if $?.exitstatus and output.match(/[Ss]udo[ \-][Vv]ersion ([\d\.]+)/)
Facter.add("sudoversion") do
setcode do

0 comments on commit 432d2b9

Please sign in to comment.