Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
Platform OS
-
Platform OS Kanban
Description
When there is output to stdout in facts it creates a problem with the format options:
Facter.add('test') do |
confine :kernel => 'Linux' |
begin
|
test = 'nomatch' |
test = Facter.value(:doesntexist).strip()
|
setcode { test }
|
rescue Exception => ex
|
puts "#{File.basename(__FILE__)} - ruby fact threw an exception: #{ex}" |
end
|
end
|
Output:
# facter -p -j test
|
test.rb - ruby fact threw an exception: undefined method `strip' for nil:NilClass |
{
|
"test": "" |
}
|
Desired Outcome:
using --json or --yaml should print the valid format even if there are messages sent to stdout.
Attachments
Issue Links
- relates to
-
FACT-1877 Add documentation for Debugging, Exceptions and Logging
-
- Needs Information
-