summaryrefslogtreecommitdiffstats
path: root/lib/facter/util/loader.rb
Commit message (Collapse)AuthorAgeFilesLines
* refactor the mechanism for allowing for resolution ordering to be influencedRichard Clamp2011-04-061-1/+1
| | | | | renames Facter::Util::Resolution#length to weight as a more generic mechanism for allowing resolutions to state their importance
* (#6740) facter doesn't always respect facts in environment variablesRichard Clamp2011-04-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | On an OSX host: $ facter operatingsystem Darwin $ facter_operatingsystem=Not_Darwin facter operatingsystem Not_Darwin But on a linux/solaris host: $ facter operatingsystem CentOS $ facter_operatingsystem=Not_CentOS facter operatingsystem CentOS As the operatingsystem fact resolution for linux-based kernels has higher precedence than the environment variable as it has more matching confines than the value from the environment variable. This patch adds from_environment to the resolution mechanism, which makes the resolution have an artificially high weight by claiming the length of its confines array is 1 billion.
* (#5510) Facter should load custom fact definitions in filename order.Rick Bradley2011-01-311-2/+2
| | | | | | | | | | | | | | | | Ruby's Dir.entries will return files in different orders depending on the OS and/or filesystem. As a result Facter::Util::Loader will load ruby custom fact definitions in different orders on different platforms. Specs to expose the bugs, and code to ensure that custom fact files are loaded in alphabetical order. Addresses redmine issue #5510 http://projects.puppetlabs.com/issues/5510 Signed-off-by: Rick Bradley <rick@rickbradley.com> Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
* Fix 2455 - improve error handling on fact loadPaul Nasrat2009-09-091-1/+5
| | | | | | Fix facts added with empty blocks by handling calls to value when setcode not called Ensure we handle load failures more gracefully
* Switching to a search path registration system.Luke Kanies2008-05-161-12/+3
| | | | | Facter no longer knows anything about Puppet, so there's no inter-dependency issue.
* Moving the puppet-related loading tests to an integration test.Luke Kanies2008-05-161-3/+11
| | | | | | | | | I was previously creating a mock Puppet class, and this actually uses Puppet's code. Note that this use of Puppet creates some additional ordering problems, which I'm going to fix in the next commit by undoing all of this work. :)
* Switching Facter to using the new loader.Luke Kanies2008-05-151-46/+16
| | | | | This should make it possible to move all facts to separate files and only load them on demand.
* Moving all of the support classes to util/.Luke Kanies2008-05-151-0/+127
This makes it easier for our loader to distinguish between code that Facter uses and new facts.