Host discovery fails with undefined method `new` for nil:NIlClass
The problem is that in the old (pre-PR) code importers registry is kept in FactImporter class that gets reloaded. Once the class is reloaded, it looses its default importer registration that point to puppet. See my comment for more information.
This is a regression in the import_facts core codebase introduced by #15409.
Let's add one REAL (non-mocked) test of discovering a host :-)
- Assignee set to Rahul Bajaj
- Related to Bug #21653: Unable to render host without memory info added
As per IRC, the issue is in Host::Base#import_facts:
type = facts.delete(:_type)
It was previously:
type = facts.delete(:_type) || 'puppet'
- Category deleted (
- Project changed from Discovery to Foreman
- Pull request https://github.com/theforeman/foreman/pull/5010 added
- Related to Bug #22705: Must use the ImporterRegistry rather than FactImporter added
- Status changed from New to Ready For Testing
It looks like this happens only when Rails reloads some classes: #21573
- Related to Bug #21573: Importing facts in development breaks on code reload added
- Description updated (diff)
- Fixed in Releases 2.1.0 added
- Status changed from Ready For Testing to Closed
Also available in: Atom