Red Hat Bugzilla – Bug 1202779
Creating a host without OS set gives undefined method `boot_filename' exception
Last modified: 2017-02-23 15:18:01 EST
When no OS is assigned for host or host group, provisioning ends up with this weird error instead of nice one. Fix was already delivered upstream (Foreman 1.8), we only need to cherry pick small patch in core.
Jason, the patch in foreman core fixes this: https://github.com/theforeman/foreman/pull/2120/files Giving it a POST already, yeah, I am a bad boy!
Verified with sanp4 compose2.. Issue is reproducible 2015-05-15 16:58:20 [I] Processing by DiscoveredHostsController#update as */* 2015-05-15 16:58:20 [I] Parameters: {"utf8"=>"✓", "authenticity_token"=>"o5Vg3xdsjhXm5y3/xk0LOUA10jllWL4VZGl+9ABdwUo=", "host"=>{"name"=>"mac52540050266d", "hostgroup_id"=>"1", "environment_id"=>"3", "content_source_id"=>"2", "puppet_ca_proxy_id"=>"2", "puppet_proxy_id"=>"2", "puppetclass_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "domain_id"=>"1", "realm_id"=>"", "mac"=>"52:54:00:50:26:6d", "subnet_id"=>"2", "ip"=>"192.168.110.33", "interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"", "domain_id"=>"", "subnet_id"=>"", "ip"=>"", "managed"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>""}}, "architecture_id"=>"1", "operatingsystem_id"=>"", "build"=>"1", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"3-Users", "enabled"=>"1", "model_id"=>"2", "comment"=>"", "overwrite"=>"false"}, "hostgroup"=>{"lifecycle_environment_id"=>"2", "content_view_id"=>"2"}, "id"=>"mac52540050266d"} 2015-05-15 16:58:20 [W] Operation FAILED: undefined method `boot_filename' for nil:NilClass 2015-05-15 16:58:20 [I] Rendered common/500.html.erb (7.0ms) 2015-05-15 16:58:20 [I] Completed 500 Internal Server Error in 321ms (Views: 8.0ms | ActiveRecord: 15.7ms) 2015-05-15 16:58:21 [I] Processing by DiscoveredHostsController#edit as */* 2
Created attachment 1025817 [details] screenshot from sanp4 c2
I am getting correct behavior (Can't be blank) now.
Verified with sat6.1.1 snap11 compose2. creating a host without associating OS gives "Can't be blank".
Created attachment 1049823 [details] Creating a host without OS now raises "can't be blank" validation error
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2015:1592