Actions
Bug #2690
closedundefined method `gsub!' for nil:NilClass on fact import
Description
Fact imports fail on Fedora 18:
Started POST "/fact_values/create?format=yml" for 192.168.101.107 at 2013-06-21 12:14:32 +0000 Processing by FactValuesController#create as YML Parameters: {"facts"=>"[FILTERED]"} Failed to import facts: undefined method `gsub!' for nil:NilClass /usr/share/foreman/app/models/facts_importer.rb:34:in `operatingsystem' /usr/share/foreman/app/models/host/base.rb:153:in `block in set_non_empty_values' /usr/share/foreman/app/models/host/base.rb:152:in `each' /usr/share/foreman/app/models/host/base.rb:152:in `set_non_empty_values' /usr/share/foreman/app/models/host/base.rb:147:in `populateFieldsFromFacts' /usr/share/foreman/app/models/host/managed.rb:380:in `populateFieldsFromFacts' /usr/share/foreman/app/models/host/base.rb:79:in `importFacts' /usr/share/foreman/app/models/host/managed.rb:370:in `importHostAndFacts' /usr/share/foreman/app/controllers/fact_values_controller.rb:28:in `block in create'
It appears this code isn't capable of dealing with OS version numbers with a nil minor component:
app/models/facts_importer.rb: 32 major, minor = orel.split(".") 33 major.gsub!(/\D/,'') unless is_numeric? major 34 minor.gsub!(/\D/,'') unless is_numeric? minor 35 minor ||= ""
Actions