Project

General

Custom queries

Profile

Actions

Bug #21654

closed

Host discovery fails with undefined method `new` for nil:NIlClass

Added by Lukas Zapletal over 7 years ago. Updated almost 5 years ago.

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

Description

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 :-)


Related issues 4 (0 open4 closed)

Related to Discovery - Bug #21653: Unable to render host without memory infoClosedOri Rabin11/14/2017Actions
Related to Katello - Bug #22705: Must use the ImporterRegistry rather than FactImporterClosedRahul BajajActions
Related to Foreman - Bug #21573: Importing facts in development breaks on code reloadDuplicateActions
Related to Foreman - Bug #34026: Importing puppet report via the API does not authorizeClosedLukas ZapletalActions
Actions #3

Updated by Lukas Zapletal over 7 years ago

As per IRC, the issue is in Host::Base#import_facts:

type = facts.delete(:_type)

It was previously:

type = facts.delete(:_type) || 'puppet'
Actions #8

Updated by Lukas Zapletal almost 7 years ago

  • Triaged set to No

It looks like this happens only when Rails reloads some classes: #21573

Actions #12

Updated by Rahul Bajaj about 5 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF