@ -1,4 +1,4 @@
From c823dd47277bc88b95062dda726800860c75f1c3 Mon Sep 17 00:00:00 2001
From 39382efcf16e3f3b30ce8284ae3aefcf09b1b2d6 Mon Sep 17 00:00:00 2001
From: Todd Zullinger <tmz@pobox.com>
Date: Fri, 29 Mar 2013 19:31:59 -0400
Subject: [PATCH] (#19989) Filter virt-what warnings from virtual fact
@ -17,6 +17,11 @@ A virt-what fix was committed upstream¹.
Thanks to Adrien Thebo for help on making this testable.
This also rolls in a follow-up fix to suppress warnings when virt-what
produces no output:
4a59d36 ((Maint) Don't parse nil Facter::Util::Resolution output)
¹ http://git.annexia.org/?p=virt-what.git;a=commitdiff;h=2f47e06
Conflicts:
@ -27,7 +32,7 @@ Conflicts:
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/lib/facter/util/virtual.rb b/lib/facter/util/virtual.rb
index 41472b8.. b 5fa09d 100644
index 41472b8.. 534 f31 a 100644
--- a/lib/facter/util/virtual.rb
+++ b/lib/facter/util/virtual.rb
@@ -3,8 +3,16 @@ module Facter::Util::Virtual
@ -44,7 +49,7 @@ index 41472b8..b5fa09d 100644
- Facter::Util::Resolution.exec command
+ redirected_cmd = "#{command} 2>/dev/null"
+ output = Facter::Util::Resolution.exec redirected_cmd
+ output.gsub(/^virt-what: .*$/, '')
+ output.gsub(/^virt-what: .*$/, '') if output
end
##