diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-07-10 04:17:07 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-07-10 04:17:07 +0000 |
| commit | e662c869bf8b2924c12d4ff6f999f0744779257d (patch) | |
| tree | b57a7c661f3a6179c0a13b0b155142064062141a /lib/puppet/network/client | |
| parent | 7befe1bc5ac9d4524c4c43514a24f1bb19b74727 (diff) | |
| download | puppet-e662c869bf8b2924c12d4ff6f999f0744779257d.tar.gz puppet-e662c869bf8b2924c12d4ff6f999f0744779257d.tar.xz puppet-e662c869bf8b2924c12d4ff6f999f0744779257d.zip | |
Fixing #621 -- plugins are now downloaded directly into the $libdir, and autoload looks for them there. You can now easily download any reloadable file to your clients.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2669 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/network/client')
| -rw-r--r-- | lib/puppet/network/client/master.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb index 8d141f33f..0ac81c055 100644 --- a/lib/puppet/network/client/master.rb +++ b/lib/puppet/network/client/master.rb @@ -454,18 +454,20 @@ class Puppet::Network::Client::Master < Puppet::Network::Client # Retrieve the plugins from the central server. We only have to load the # changed plugins, because Puppet::Type loads plugins on demand. def self.getplugins - path = Puppet[:pluginpath].split(":") download(:dest => Puppet[:plugindest], :source => Puppet[:pluginsource], :ignore => Puppet[:pluginsignore], :name => "plugin") do |object| - next unless path.include?(::File.dirname(object[:path])) + next if FileTest.directory?(object[:path]) + path = object[:path].sub(Puppet[:plugindest], '').sub(/^\/+/, '') + unless Puppet::Util::Autoload.loaded?(path) + next + end begin - Puppet.info "Reloading plugin %s" % - ::File.basename(::File.basename(object[:path])).sub(".rb",'') + Puppet.info "Reloading downloaded file %s" % path load object[:path] rescue => detail - Puppet.warning "Could not reload plugin %s: %s" % + Puppet.warning "Could not reload downloaded file %s: %s" % [object[:path], detail] end end |
