summaryrefslogtreecommitdiffstats
path: root/lib/facter/util/resolution.rb
Commit message (Collapse)AuthorAgeFilesLines
* refactor the mechanism for allowing for resolution ordering to be influencedRichard Clamp2011-04-061-10/+7
| | | | | 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-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [#4552] Updating --timing to report in milliseconds instead of secondsRein Henrichs2010-10-041-6/+4
|
* [#4552] Apply patch from Dean WilsonRein Henrichs2010-10-041-0/+9
|
* Fixed #3393 - Updates to Facter for MS WindowsDavid Schmitt2010-06-151-11/+34
| | | | | | | | | | This patch is originally by Daniel Berger <djberg96@gmail.com>, I changed using Facter.value instead of repeatedly testing Config['host_os'], removed Resolution::which, and fixed the specs. Thanks to Paul Nasrat for helping with cross-platform debugging. Signed-off-by: David Schmitt <david@dasz.at>
* Revert "use popen3 in Resolution.exec"Paul Nasrat2010-02-281-17/+6
| | | | | | | | | | | This reverts commit 33fb7709404e706801683e6c47ab7a0a5a1884b1. This has broken master for some facts (eg OS X facts), it also breaks facter platform support on win32 as popen3 does not work there. I'd like to get master working, backlog of patches applied and revisit exec. Paul
* use popen3 in Resolution.exec to catch stderrPeter Meier2009-11-081-6/+17
| | | | | | | | | | | | | | | | | | | So far messages to stderr haven't been catched by Facter::Util::Resolution.exec and were insted printed out to stderr. This will cause facter and even puppet to print to stderr themself, which is not very nice when running puppetd by cron, as you might get every run a mail if a command outputs to stderr. We are now wrapping the command execution with Open3.popen3 to catch stderr and passing them to the new introduced Facter.warn method. We are also catching multiline outputs chomping newlines and returning an array if there have been more than one line. Otherwise we return an array containing the different lines. This prevents in general cases as described in #2766 and should handle command execution in a bit saner way.
* Fix 2455 - improve error handling on fact loadPaul Nasrat2009-09-091-0/+1
| | | | | | Fix facts added with empty blocks by handling calls to value when setcode not called Ensure we handle load failures more gracefully
* Fix to stdout in resolution.rbJames Turnbull2009-03-171-2/+2
|
* Fixing #1927 - failing facts don't kill FacterLuke Kanies2009-02-041-0/+3
| | | | | | Facts that raise exceptions just return nil now. Signed-off-by: Luke Kanies <luke@madstop.com>
* Added a Process.waitall thread when there's a timeout, to avoid zombies.Luke Kanies2008-08-181-0/+5
| | | | Without this call, every time there's a timeout, we'll get a zombie.
* Facter fix #1422, no default timeoutPaul Nasrat2008-08-181-1/+1
|
* Bug #1434 Don't execute which on windowsPaul Nasrat2008-07-171-2/+7
|
* Retaining 'timeout' as the settor, but using 'limit' as the getter.Luke Kanies2008-06-201-2/+9
| | | | | | | I don't like using Fact.add(:fact, :limit => 5), so I added a little extra code to allow us to continue using ':timeout => 5', but use 'limit' for retrieving the value, to avoid the conflict Steve Hajducko is seeing.
* Changed 'timeout' option to 'limit'Steven Hajducko2008-06-191-3/+3
| | | | | This was done to avoid a possible variable scoping issue that was occuring on some AIX systems.
* Fixing some warnings in various classes.Luke Kanies2008-06-191-1/+1
|
* Refactored so each fact resolution can specify a separate timeout,Luke Kanies2008-06-171-5/+16
| | | | | | but the default is still 0.5. Set the timeout on the AIX kernelrelease fact to 5 seconds.
* Moving all of the support classes to util/.Luke Kanies2008-05-151-0/+107
This makes it easier for our loader to distinguish between code that Facter uses and new facts.