| When you query for a custom structured fact, Facter uses Hash#dig to cicle through keys, but this can fail if the value of one of the cicled keys is not a Hash. Simple ruby example:
❯ ruby -e '{"a" => "b"}.dig("a", "z")' |
Traceback (most recent call last): |
1: from -e:1:in `<main>' |
-e:1:in `dig': String does not have #dig method (TypeError)
|
Steps to reproduce in Facter: 1. create a custom fact
Facter.add('foo.bar') do |
setcode { 'baz' } |
end
|
Query for that fact name and an extra key:
❯ bx facter foo.bar.x |
|
facter-4.0.52/lib/facter/framework/formatters/formatter_helper.rb:28:in `dig': String does not have #dig method (TypeError)
|
|