The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Bug #5279

Facter util loader loads files from everywhere in $LOAD_PATH, makes tests fail

Added by Matt Robinson over 5 years ago. Updated over 5 years ago.

Status:DuplicateStart date:11/12/2010
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Keywords: Affected Facter version:
Branch:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com


Description

I’m not entirely sure if this is a problem with implementation also. However, for testing it means that if you have a different version of facter installed on the machine than the version of the code you want to test, the test may end up running the wrong code.

lib/facter/util/loader.rb

search_path and load_all combine to load every file in the load path, which may be facter running from source AND facter installed in whatever directory the load path normally looks in.


Related issues

Duplicates Facter - Feature #4551: Command line add/remove search paths Accepted 08/17/2010

History

#1 Updated by Paul Nasrat over 5 years ago

  • Status changed from Unreviewed to Duplicate

Pretty sure this is a dupe of issue #4551 which I filed for this issue.

#2 Updated by Paul Nasrat over 5 years ago

Note for 2.0 we want to change loader behaviour as in the roadmap.

#3 Updated by Paul Berry over 5 years ago

Nick and I ran into this while working on the demo machine for the 11/17 iteration. The home directory of the demo machine contained a dir called “facter” which was the source code to facter. This made errors occur if you tried to run “facter” from the home directory.

#4 Updated by Paul Nasrat over 5 years ago

Yeah it’s well known hence the comment in ArchitectureForTwoDotOh

  • Facts shouldn’t be in lib/ (should probably be /var somewhere)

Changing this in 1.x would break a lot of peoples setup, sadly it tends to bite developers/CI systems worst, along with a few cases of multiple installs.

Also available in: Atom PDF