Actions
Bug #29719
closedHostgroup facets with inheritable attributes cause errors on hostgroups without instances of the facet
Description
When a hostgroup facet has been registered, along with a host facet and inheritable attributes, then any attempts to select a hostgroup that has no instance of said hostgroup facet errors out with a NoMethodError.
The stacktrace in question;
from app/models/concerns/facets/hostgroup_extensions.rb:25:in `inherited_facet_attributes' from app/models/concerns/facets/base.rb:45:in `inherited_attributes' from app/models/concerns/facets/base_host_extensions.rb:18:in `block in apply_facet_attributes' from app/models/concerns/facets/base_host_extensions.rb:16:in `map' from app/models/concerns/facets/base_host_extensions.rb:16:in `apply_facet_attributes' from app/models/host/managed.rb:557:in `apply_inherited_attributes' from app/models/host/managed.rb:70:in `initialize' from active_record/inheritance.rb:66:in `new' from active_record/inheritance.rb:66:in `new' from app/models/concerns/foreman/sti.rb:19:in `new' from app/models/host.rb:15:in `method_missing' from app/controllers/hosts_controller.rb:661:in `refresh_host' from app/controllers/hosts_controller.rb:586:in `process_hostgroup' from action_controller/metal/basic_implicit_render.rb:6:in `send_action'
I looked through the call trace and it seems like there's nothing that actually checks if the hostgroup has an instance of the facet before attempting to read inherited attributes from it.
Updated by The Foreman Bot over 4 years ago
- Status changed from New to Ready For Testing
- Assignee set to Alexander Olofsson
- Pull request https://github.com/theforeman/foreman/pull/7642 added
Updated by Anonymous over 4 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset 709e5fd0e6231e3fadd8e61985a76fc58444753d.
Updated by Tomer Brisker over 4 years ago
- Fixed in Releases 2.1.0 added
- Fixed in Releases deleted (
2.2.0)
Actions