From fae8ae4476142112db877470fe6d374c0e63acc9 Mon Sep 17 00:00:00 2001 From: Jarl Stefansson Date: Tue, 7 Jan 2014 13:29:00 -0500 Subject: Silence facter by redirecting python -V stderr --- lib/facter/python_version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/facter/python_version.rb b/lib/facter/python_version.rb index a2bdb26..6b88ee9 100644 --- a/lib/facter/python_version.rb +++ b/lib/facter/python_version.rb @@ -14,7 +14,7 @@ end Facter.add("python_version") do has_weight 100 setcode do - /^.*(\d+\.\d+\.\d+)$/.match(Facter::Util::Resolution.exec('python -V'))[1] + /^.*(\d+\.\d+\.\d+)$/.match(Facter::Util::Resolution.exec('python -V 2>/dev/null'))[1] end end -- cgit v1.2.3 From 25d7203f8c7c152dcc4ecd75569effebee9ba25a Mon Sep 17 00:00:00 2001 From: Jarl Stefansson Date: Tue, 7 Jan 2014 14:25:42 -0500 Subject: Fix Python version detection, stderr to stdout --- lib/facter/python_version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/facter/python_version.rb b/lib/facter/python_version.rb index 6b88ee9..50fef72 100644 --- a/lib/facter/python_version.rb +++ b/lib/facter/python_version.rb @@ -14,7 +14,7 @@ end Facter.add("python_version") do has_weight 100 setcode do - /^.*(\d+\.\d+\.\d+)$/.match(Facter::Util::Resolution.exec('python -V 2>/dev/null'))[1] + /^.*(\d+\.\d+\.\d+)$/.match(Facter::Util::Resolution.exec('python -V 2>&1'))[1] end end -- cgit v1.2.3