summaryrefslogtreecommitdiffstats
path: root/lib/puppet/agent/plugin_handler.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-01-28 17:11:19 -0600
committerLuke Kanies <luke@madstop.com>2009-02-06 18:08:42 -0600
commitfc14b81f99adc9c9308a26d322adaa59a7b7716d (patch)
treedc731383d3195e37ea3658b9cbc7b0c428579d9f /lib/puppet/agent/plugin_handler.rb
parente8be6dcad2150769b51bf81e95c57491921e68c1 (diff)
downloadpuppet-fc14b81f99adc9c9308a26d322adaa59a7b7716d.tar.gz
puppet-fc14b81f99adc9c9308a26d322adaa59a7b7716d.tar.xz
puppet-fc14b81f99adc9c9308a26d322adaa59a7b7716d.zip
Splitting the Agent class into Agent and Configurer
Once I went to add runinterval support to the Agent class, I realized it's really two classes: One that handles starting, stopping, running, et al (still called Agent), and one that handles downloading the catalog, running it, etc. (now called Configurer). This commit includes some additional code, but 95% of it is just moving code around. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/agent/plugin_handler.rb')
-rw-r--r--lib/puppet/agent/plugin_handler.rb25
1 files changed, 0 insertions, 25 deletions
diff --git a/lib/puppet/agent/plugin_handler.rb b/lib/puppet/agent/plugin_handler.rb
deleted file mode 100644
index 306b8b6df..000000000
--- a/lib/puppet/agent/plugin_handler.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# Break out the code related to plugins. This module is
-# just included into the agent, but having it here makes it
-# easier to test.
-module Puppet::Agent::PluginHandler
- def download_plugins?
- Puppet[:pluginsync]
- end
-
- # Retrieve facts from the central server.
- def download_plugins
- return nil unless download_plugins?
- Puppet::Agent::Downloader.new("plugin", Puppet[:pluginsource], Puppet[:plugindest], Puppet[:pluginsignore]).evaluate.each { |file| load_plugin(file) }
- end
-
- def load_plugin(file)
- return if FileTest.directory?(file)
-
- begin
- Puppet.info "Loading downloaded plugin %s" % file
- load file
- rescue Exception => detail
- Puppet.err "Could not load downloaded file %s: %s" % [file, detail]
- end
- end
-end