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 #1

Updated by The Foreman Bot about 5 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Evgeni Golov
  • Pull request https://github.com/theforeman/foreman/pull/7535 added
Actions #2

Updated by Ewoud Kohl van Wijngaarden over 2 years ago

  • Status changed from Ready For Testing to New
Actions

Also available in: Atom PDF