Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 432d2b9e9ccf85d917210df750d0841c79e6bd60 1 parent 450b6e9
@ckaenzig ckaenzig authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/facter/sudo.rb
View
2  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
Please sign in to comment.
Something went wrong with that request. Please try again.