summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-07-01 12:57:56 -0500
committerLuke Kanies <luke@madstop.com>2008-07-01 12:57:56 -0500
commitee9d0025eeebda1522d450b5bd3cda769d7455d5 (patch)
tree9c03a2ff0d8d943674d00ae1de388085b533e590 /lib
parent117869fa1614cd3b4ff4e5e0df5ece699eb1fe56 (diff)
downloadpuppet-ee9d0025eeebda1522d450b5bd3cda769d7455d5.tar.gz
puppet-ee9d0025eeebda1522d450b5bd3cda769d7455d5.tar.xz
puppet-ee9d0025eeebda1522d450b5bd3cda769d7455d5.zip
Fixed #1114 - Facts in plugin directories should now be autoloaded,
as long as you're using Facter 1.5.
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/network/client/master.rb37
1 files changed, 17 insertions, 20 deletions
diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb
index 22bb3fa4e..0de3a117b 100644
--- a/lib/puppet/network/client/master.rb
+++ b/lib/puppet/network/client/master.rb
@@ -26,6 +26,20 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
down = Puppet[:downcasefacts]
+ Facter.clear
+
+ # Reload everything.
+ if Facter.respond_to? :loadfacts
+ Facter.loadfacts
+ elsif Facter.respond_to? :load
+ Facter.load
+ else
+ Puppet.warning "You should upgrade your version of Facter to at least 1.3.8"
+ end
+
+ # This loads all existing facts and any new ones. We have to remove and
+ # reload because there's no way to unload specific facts.
+ loadfacts()
facts = Facter.to_hash.inject({}) do |newhash, array|
name, fact = array
if down
@@ -115,6 +129,9 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
def getconfig
dostorage()
+ # Retrieve the plugins.
+ getplugins() if Puppet[:pluginsync]
+
facts = nil
Puppet::Util.benchmark(:debug, "Retrieved facts") do
facts = self.class.facts
@@ -122,9 +139,6 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
raise Puppet::Network::ClientError.new("Could not retrieve any facts") unless facts.length > 0
- # Retrieve the plugins.
- getplugins() if Puppet[:pluginsync]
-
Puppet.debug("Retrieving catalog")
# If we can't retrieve the catalog, just return, which will either
@@ -340,23 +354,6 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
files << resource[:path]
end
- ensure
- # Clear all existing definitions.
- Facter.clear
-
- # Reload everything.
- if Facter.respond_to? :loadfacts
- Facter.loadfacts
- elsif Facter.respond_to? :load
- Facter.load
- else
- raise Puppet::Error,
- "You must upgrade your version of Facter to use centralized facts"
- end
-
- # This loads all existing facts and any new ones. We have to remove and
- # reload because there's no way to unload specific facts.
- loadfacts()
end
# Retrieve the plugins from the central server. We only have to load the