Fixing #1927 - failing facts don't kill Facter
Facts that raise exceptions just return nil now.
Signed-off-by: Luke Kanies <luke@madstop.com>
Luke Kanies authored 15 years ago
James Turnbull committed 15 years ago
0 | 0 |
1.5.4:
|
|
1 |
Fixed #1927 - failing facts don't kill Facter
|
|
2 |
|
1 | 3 |
Fixed #1850 - Facter updates for Ruby 1.9
|
2 | 4 |
|
3 | 5 |
Fixed #1926 - IPAddr to_s issue
|
126 | 126 |
# of the timeout.
|
127 | 127 |
Thread.new { Process.waitall }
|
128 | 128 |
return nil
|
|
129 |
rescue => details
|
|
130 |
warn "Could not retrieve %s: %s" % [self.name, details]
|
|
131 |
return nil
|
129 | 132 |
end
|
130 | 133 |
|
131 | 134 |
return nil if result == ""
|
86 | 86 |
end
|
87 | 87 |
|
88 | 88 |
describe "and the code is a block" do
|
|
89 |
it "should warn but not fail if the code fails" do
|
|
90 |
@resolve.setcode { raise "feh" }
|
|
91 |
@resolve.expects(:warn)
|
|
92 |
@resolve.value.should be_nil
|
|
93 |
end
|
|
94 |
|
89 | 95 |
it "should return the value returned by the block" do
|
90 | 96 |
@resolve.setcode { "yayness" }
|
91 | 97 |
@resolve.value.should == "yayness"
|