Project

General

Profile

Actions

Bug #21653

closed

Unable to render host without memory info

Added by Lukas Zapletal over 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Hammer CLI
Difficulty:
trivial
Triaged:
Fixed in Releases:
Found in Releases:

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'

Related issues 1 (0 open1 closed)

Related to Foreman - Bug #21654: Host discovery fails with undefined method `new` for nil:NIlClassClosedRahul BajajActions
Actions

Also available in: Atom PDF