Actions
Bug #21653
closedUnable to render host without memory info
Difficulty:
trivial
Triaged:
Description
Hosts without delegated attributes cannot be displayed with hammer list. The problematic delegate is:
delegate :memory, :cpu_count, :disk_count, :disks_size, :to => :discovery_attribute_set
when the delegate is nil. Exception:
[app|W] Action failed | ActionView::Template::Error: Host::Discovered#memory delegated to discovery_attribute_set.memory, but discovery_attribute_set is nil: #<Host::Discovered id: 95, name: "mac52babbd408d4", last_compile: nil, last_report: nil, updated_at: "2017-11-08 16:08:22", created_at: "2017-11-08 16:08:22", root_pass: nil, architecture_id: nil, operatingsystem_id: nil, environment_id: nil, ptable_id: nil, medium_id: nil, build: false, comment: nil, disk: nil, installed_at: nil, model_id: nil, hostgroup_id: nil, owner_id: nil, owner_type: nil, enabled: true, puppet_ca_proxy_id: nil, managed: false, use_image: nil, image_file: nil, uuid: nil, compute_resource_id: nil, puppet_proxy_id: nil, certname: nil, image_id: nil, organization_id: nil, location_id: nil, type: "Host::Discovered", otp: nil, realm_id: nil, compute_profile_id: nil, provision_method: nil, grub_pass: "", discovery_rule_id: nil, global_status: 0, lookup_value_matcher: nil, pxe_loader: nil> | /home/lzap/work/foreman_discovery/app/models/host/discovered.rb:12:in `rescue in memory' | /home/lzap/work/foreman_discovery/app/models/host/discovered.rb:12:in `memory' | /home/lzap/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rabl-0.13.1/lib/rabl/helpers.rb:16:in `data_object_attribute' | /home/lzap/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rabl-0.13.1/lib/rabl/builder.rb:140:in `attribute' | /home/lzap/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rabl-0.13.1/lib/rabl/builder.rb:114:in `block in compile_settings' | /home/lzap/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rabl-0.13.1/lib/rabl/builder.rb:113:in `each' | /home/lzap/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rabl-0.13.1/lib/rabl/builder.rb:113:in `compile_settings'
Actions