summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/configuration.rb6
-rw-r--r--lib/puppet/network/client/master.rb12
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