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 | |
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')
-rw-r--r-- | lib/puppet/configuration.rb | 6 | ||||
-rw-r--r-- | lib/puppet/network/client/master.rb | 12 |
2 files changed, 11 insertions, 7 deletions
diff --git a/lib/puppet/configuration.rb b/lib/puppet/configuration.rb index 1589fc01b..79ada647b 100644 --- a/lib/puppet/configuration.rb +++ b/lib/puppet/configuration.rb @@ -436,8 +436,10 @@ module Puppet self.setdefaults(:main, :pluginpath => ["$vardir/plugins", "Where Puppet should look for plugins. Multiple directories should - be colon-separated, like normal PATH variables."], - :plugindest => ["$vardir/plugins", + be colon-separated, like normal PATH variables. As of 0.23.1, this + option is deprecated; download your custom libraries to the $libdir + instead."], + :plugindest => ["$libdir", "Where Puppet should store plugins that it pulls down from the central server."], :pluginsource => ["puppet://$server/plugins", 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 |