Codebase list facter / f4bc74d
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
3 changed file(s) with 11 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
00 1.5.4:
1 Fixed #1927 - failing facts don't kill Facter
2
13 Fixed #1850 - Facter updates for Ruby 1.9
24
35 Fixed #1926 - IPAddr to_s issue
126126 # of the timeout.
127127 Thread.new { Process.waitall }
128128 return nil
129 rescue => details
130 warn "Could not retrieve %s: %s" % [self.name, details]
131 return nil
129132 end
130133
131134 return nil if result == ""
8686 end
8787
8888 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
8995 it "should return the value returned by the block" do
9096 @resolve.setcode { "yayness" }
9197 @resolve.value.should == "yayness"