As the method for Hostgroup#inherited_facet_attributes - and methods that call it - include no checks for if a hostgroup includes an instance of the requested facet before trying to read attributes from it, this can lead to a NoMethodError here.
Wrapping it in a safe accessor and a fallback to an empty hash means that such calls will no longer error, and will still read attributes correctly from the ancestry as well.
Fixes #29719 - Hostgroup facet inheritance error (#7642)
As the method for Hostgroup#inherited_facet_attributes - and methods
that call it - include no checks for if a hostgroup includes an
instance of the requested facet before trying to read attributes from
it, this can lead to a NoMethodError here.
Wrapping it in a safe accessor and a fallback to an empty hash means
that such calls will no longer error, and will still read attributes
correctly from the ancestry as well.