Codebase list facter / c392d55
add patch to ignore the No LSB modules are available. noise Micah Anderson 11 years ago
3 changed file(s) with 182 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 facter (1.6.9-2) unstable; urgency=medium
1
2 * Add patch from upstream (b050eb1) to ignore LSB noise
3
4 -- Micah Anderson <micah@debian.org> Wed, 30 May 2012 11:26:27 -0400
5
06 facter (1.6.9-1) unstable; urgency=low
17
28 * New upstream release
0 commit b050eb1118512488949394803b371a3d02a730ad
1 Author: Hailee Kenney <hailee@puppetlabs.com>
2 Date: Fri May 18 12:28:13 2012 -0700
3
4 (#14582) Fix noise in LSB facts
5
6 Redirect LSB fact's stderr to /dev/null to prevent excess noise.
7
8 diff --git a/lib/facter/lsbdistcodename.rb b/lib/facter/lsbdistcodename.rb
9 index 00b514a..0c0f5d9 100644
10 --- a/lib/facter/lsbdistcodename.rb
11 +++ b/lib/facter/lsbdistcodename.rb
12 @@ -13,6 +13,6 @@
13 Facter.add(:lsbdistcodename) do
14 confine :kernel => [ :linux, :"gnu/kfreebsd" ]
15 setcode do
16 - Facter::Util::Resolution.exec('lsb_release -c -s')
17 + Facter::Util::Resolution.exec('lsb_release -c -s 2>/dev/null')
18 end
19 end
20 diff --git a/lib/facter/lsbdistdescription.rb b/lib/facter/lsbdistdescription.rb
21 index fb3d760..a4275b2 100644
22 --- a/lib/facter/lsbdistdescription.rb
23 +++ b/lib/facter/lsbdistdescription.rb
24 @@ -13,7 +13,7 @@
25 Facter.add(:lsbdistdescription) do
26 confine :kernel => [ :linux, :"gnu/kfreebsd" ]
27 setcode do
28 - if output = Facter::Util::Resolution.exec('lsb_release -d -s')
29 + if output = Facter::Util::Resolution.exec('lsb_release -d -s 2>/dev/null')
30 # the output may be quoted (at least it is on gentoo)
31 output.sub(/^"(.*)"$/,'\1')
32 end
33 diff --git a/lib/facter/lsbdistid.rb b/lib/facter/lsbdistid.rb
34 index 61d3ac2..065ef9b 100644
35 --- a/lib/facter/lsbdistid.rb
36 +++ b/lib/facter/lsbdistid.rb
37 @@ -13,6 +13,6 @@
38 Facter.add(:lsbdistid) do
39 confine :kernel => [ :linux, :"gnu/kfreebsd" ]
40 setcode do
41 - Facter::Util::Resolution.exec('lsb_release -i -s')
42 + Facter::Util::Resolution.exec('lsb_release -i -s 2>/dev/null')
43 end
44 end
45 diff --git a/lib/facter/lsbdistrelease.rb b/lib/facter/lsbdistrelease.rb
46 index 4c8c736..ae5a9b2 100644
47 --- a/lib/facter/lsbdistrelease.rb
48 +++ b/lib/facter/lsbdistrelease.rb
49 @@ -13,6 +13,6 @@
50 Facter.add(:lsbdistrelease) do
51 confine :kernel => [ :linux, :"gnu/kfreebsd" ]
52 setcode do
53 - Facter::Util::Resolution.exec('lsb_release -r -s')
54 + Facter::Util::Resolution.exec('lsb_release -r -s 2>/dev/null')
55 end
56 end
57 diff --git a/lib/facter/lsbrelease.rb b/lib/facter/lsbrelease.rb
58 index 9b1d546..a1728bb 100644
59 --- a/lib/facter/lsbrelease.rb
60 +++ b/lib/facter/lsbrelease.rb
61 @@ -13,6 +13,6 @@
62 Facter.add(:lsbrelease) do
63 confine :kernel => [ :linux, :"gnu/kfreebsd" ]
64 setcode do
65 - Facter::Util::Resolution.exec('lsb_release -v -s')
66 + Facter::Util::Resolution.exec('lsb_release -v -s 2>/dev/null')
67 end
68 end
69 diff --git a/spec/unit/lsbdistcodename_spec.rb b/spec/unit/lsbdistcodename_spec.rb
70 index fa012a8..e30aada 100755
71 --- a/spec/unit/lsbdistcodename_spec.rb
72 +++ b/spec/unit/lsbdistcodename_spec.rb
73 @@ -10,13 +10,13 @@ describe "lsbdistcodename fact" do
74 Facter.fact(:kernel).stubs(:value).returns kernel
75 end
76
77 - it "should return the codename through lsb_release -c -s" do
78 - Facter::Util::Resolution.stubs(:exec).with('lsb_release -c -s').returns 'n/a'
79 + it "should return the codename through lsb_release -c -s 2>/dev/null" do
80 + Facter::Util::Resolution.stubs(:exec).with('lsb_release -c -s 2>/dev/null').returns 'n/a'
81 Facter.fact(:lsbdistcodename).value.should == 'n/a'
82 end
83
84 it "should return nil if lsb_release is not installed" do
85 - Facter::Util::Resolution.stubs(:exec).with('lsb_release -c -s').returns nil
86 + Facter::Util::Resolution.stubs(:exec).with('lsb_release -c -s 2>/dev/null').returns nil
87 Facter.fact(:lsbdistcodename).value.should be_nil
88 end
89 end
90 diff --git a/spec/unit/lsbdistdescription_spec.rb b/spec/unit/lsbdistdescription_spec.rb
91 index 5202e88..31f7761 100755
92 --- a/spec/unit/lsbdistdescription_spec.rb
93 +++ b/spec/unit/lsbdistdescription_spec.rb
94 @@ -10,13 +10,13 @@ describe "lsbdistdescription fact" do
95 Facter.fact(:kernel).stubs(:value).returns kernel
96 end
97
98 - it "should return the description through lsb_release -d -s" do
99 - Facter::Util::Resolution.stubs(:exec).with('lsb_release -d -s').returns '"Gentoo Base System release 2.1"'
100 + it "should return the description through lsb_release -d -s 2>/dev/null" do
101 + Facter::Util::Resolution.stubs(:exec).with('lsb_release -d -s 2>/dev/null').returns '"Gentoo Base System release 2.1"'
102 Facter.fact(:lsbdistdescription).value.should == 'Gentoo Base System release 2.1'
103 end
104
105 it "should return nil if lsb_release is not installed" do
106 - Facter::Util::Resolution.stubs(:exec).with('lsb_release -d -s').returns nil
107 + Facter::Util::Resolution.stubs(:exec).with('lsb_release -d -s 2>/dev/null').returns nil
108 Facter.fact(:lsbdistdescription).value.should be_nil
109 end
110 end
111 diff --git a/spec/unit/lsbdistid_spec.rb b/spec/unit/lsbdistid_spec.rb
112 index ae208a1..8ead532 100755
113 --- a/spec/unit/lsbdistid_spec.rb
114 +++ b/spec/unit/lsbdistid_spec.rb
115 @@ -10,13 +10,13 @@ describe "lsbdistid fact" do
116 Facter.fact(:kernel).stubs(:value).returns kernel
117 end
118
119 - it "should return the id through lsb_release -i -s" do
120 - Facter::Util::Resolution.stubs(:exec).with('lsb_release -i -s').returns 'Gentoo'
121 + it "should return the id through lsb_release -i -s 2>/dev/null" do
122 + Facter::Util::Resolution.stubs(:exec).with('lsb_release -i -s 2>/dev/null').returns 'Gentoo'
123 Facter.fact(:lsbdistid).value.should == 'Gentoo'
124 end
125
126 - it "should return nil if lsb_release is not installed" do
127 - Facter::Util::Resolution.stubs(:exec).with('lsb_release -i -s').returns nil
128 + it "should return nil if lsb_release is not installed 2>/dev/null" do
129 + Facter::Util::Resolution.stubs(:exec).with('lsb_release -i -s 2>/dev/null').returns nil
130 Facter.fact(:lsbdistid).value.should be_nil
131 end
132 end
133 diff --git a/spec/unit/lsbdistrelease_spec.rb b/spec/unit/lsbdistrelease_spec.rb
134 index 5a9803d..bd21eba 100755
135 --- a/spec/unit/lsbdistrelease_spec.rb
136 +++ b/spec/unit/lsbdistrelease_spec.rb
137 @@ -10,13 +10,13 @@ describe "lsbdistrelease fact" do
138 Facter.fact(:kernel).stubs(:value).returns kernel
139 end
140
141 - it "should return the release through lsb_release -r -s" do
142 - Facter::Util::Resolution.stubs(:exec).with('lsb_release -r -s').returns '2.1'
143 + it "should return the release through lsb_release -r -s 2>/dev/null" do
144 + Facter::Util::Resolution.stubs(:exec).with('lsb_release -r -s 2>/dev/null').returns '2.1'
145 Facter.fact(:lsbdistrelease).value.should == '2.1'
146 end
147
148 it "should return nil if lsb_release is not installed" do
149 - Facter::Util::Resolution.stubs(:exec).with('lsb_release -r -s').returns nil
150 + Facter::Util::Resolution.stubs(:exec).with('lsb_release -r -s 2>/dev/null').returns nil
151 Facter.fact(:lsbdistrelease).value.should be_nil
152 end
153 end
154 diff --git a/spec/unit/lsbrelease_spec.rb b/spec/unit/lsbrelease_spec.rb
155 index 1406da6..f1cd7fc 100755
156 --- a/spec/unit/lsbrelease_spec.rb
157 +++ b/spec/unit/lsbrelease_spec.rb
158 @@ -10,13 +10,13 @@ describe "lsbrelease fact" do
159 Facter.fact(:kernel).stubs(:value).returns kernel
160 end
161
162 - it "should return the release through lsb_release -v -s" do
163 - Facter::Util::Resolution.stubs(:exec).with('lsb_release -v -s').returns 'n/a'
164 + it "should return the release through lsb_release -v -s 2>/dev/null" do
165 + Facter::Util::Resolution.stubs(:exec).with('lsb_release -v -s 2>/dev/null').returns 'n/a'
166 Facter.fact(:lsbrelease).value.should == 'n/a'
167 end
168
169 it "should return nil if lsb_release is not installed" do
170 - Facter::Util::Resolution.stubs(:exec).with('lsb_release -v -s').returns nil
171 + Facter::Util::Resolution.stubs(:exec).with('lsb_release -v -s 2>/dev/null').returns nil
172 Facter.fact(:lsbrelease).value.should be_nil
173 end
174 end
00 no-require-rubygems
1 ignore-lsb-noise