diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-10-09 22:51:55 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-10-09 22:51:55 +0000 |
| commit | b5344f2acbf447be853af78f34a4b1562ae060f2 (patch) | |
| tree | 01094480b5eaa63e3792b9b489b102dbab3793e7 /lib/puppet/client | |
| parent | 8f9264bcc30312cc927eac72c66415eae7b69e88 (diff) | |
| download | puppet-b5344f2acbf447be853af78f34a4b1562ae060f2.tar.gz puppet-b5344f2acbf447be853af78f34a4b1562ae060f2.tar.xz puppet-b5344f2acbf447be853af78f34a4b1562ae060f2.zip | |
Fixing the problem reported by Adnet Ghislain where facts do not load on later runs.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1757 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/client')
| -rw-r--r-- | lib/puppet/client/master.rb | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/puppet/client/master.rb b/lib/puppet/client/master.rb index 8d7721ae5..0763cdfe1 100644 --- a/lib/puppet/client/master.rb +++ b/lib/puppet/client/master.rb @@ -539,9 +539,10 @@ class Puppet::Client::MasterClient < Puppet::Client # Retrieve facts from the central server. def self.getfacts - # First clear all existing definitions. + # Clear all existing definitions. Facter.clear + # Download the new facts path = Puppet[:factpath].split(":") files = [] download(:dest => Puppet[:factdest], :source => Puppet[:factsource], @@ -553,18 +554,8 @@ class Puppet::Client::MasterClient < Puppet::Client end - Facter.clear - files.each do |file| - begin - Puppet.info "Loading fact %s" % - File.basename(File.basename(file)).sub(".rb",'') - load file - rescue => detail - Puppet.warning "Could not reload fact %s: %s" % - [file, detail] - end - end ensure + # Reload everything. if Facter.respond_to? :loadfacts Facter.loadfacts elsif Facter.respond_to? :load @@ -573,6 +564,10 @@ class Puppet::Client::MasterClient < Puppet::Client 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 |
