Project

General

Profile

Actions

Bug #29387

open

facts for OS are being imported even with ignore_facts_for_operatingsystem=true

Added by Evgeni Golov about 5 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
Category:
Facts
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

when the user submits facts w/o OS, app/models/host/managed.rb still adds OS to the facts to be imported

the code reads:

    def attributes_to_import_from_facts
      attrs = [:architecture]
      if Setting[:update_hostgroup_from_facts]
        attrs << :hostgroup
      end
      if !Setting[:ignore_facts_for_operatingsystem] || (Setting[:ignore_facts_for_operatingsystem] && operatingsystem.blank?)
        attrs << :operatingsystem
      end
      if !Setting[:ignore_facts_for_domain] || (Setting[:ignore_facts_for_domain] && domain.blank?)
        attrs << :domain
      end

      super + attrs
    end

which means that if "operatingsystem" is blank and the setting is set to true (so ignore), OS is added to attrs

but as operatingsystem was blank, importing it fails miserably

reading the code the same applies for ignore_facts_for_domain=true :(

Actions

Also available in: Atom PDF