Please review pull request #178: Fix recursion on kernel fact opened by (stschulte)
Description:
We encounter a recursion if we want to detect the kernel fact for the first
time:
The kernel codeblock calls
Facter::Util::Resolution.exec("uname -s")
and Facter::Util::Resolution#exec wants to detect if we can use which
to get the full path of the command. But the method
Facter::Util::Resolution#have_which tries to query the kernel fact again
to check if we are on windows.
Change the check in have_which so we dont have to query the kernel fact.
- Opened: Sat Feb 25 14:56:07 UTC 2012
- Based on: puppetlabs:1.6.x (a51ddb718a28524a690225654f00dc698bd78cdb)
- Requested merge: stschulte:ticket/1.6.x/12831 (55323ceb16db835dae48c57290a79ae994753146)
Diff follows:
diff --git a/lib/facter/util/resolution.rb b/lib/facter/util/resolution.rb
index a5f65c3..8b62957 100644
--- a/lib/facter/util/resolution.rb
+++ b/lib/facter/util/resolution.rb
@@ -15,7 +15,7 @@ class Facter::Util::Resolution
def self.have_which
if ! defined?(@have_which) or @have_which.nil?
- if Facter.value(:kernel) == 'windows'
+ if Facter::Util::Config.is_windows?
@have_which = false
else
%x{which which >/dev/null 2>&1}
-- You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
