diff options
| author | Luke Kanies <luke@madstop.com> | 2009-02-13 21:06:34 -0600 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-02-14 22:42:51 +1100 |
| commit | 84bd5285db5a80b01dd0359387516210ccb5b625 (patch) | |
| tree | b2b160bccff29984b05732d21b6f9d65b6faa337 | |
| parent | d5abdfba8a88afda8085992a4abbe1d90bbd0084 (diff) | |
| download | puppet-84bd5285db5a80b01dd0359387516210ccb5b625.tar.gz puppet-84bd5285db5a80b01dd0359387516210ccb5b625.tar.xz puppet-84bd5285db5a80b01dd0359387516210ccb5b625.zip | |
Actualling syncing facts and plugins
Also fixing the argument order while downloading
either of them. I had my Downloader.new
calls using the wrong argument order.
Signed-off-by: Luke Kanies <luke@madstop.com>
| -rw-r--r-- | lib/puppet/configurer.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/configurer/fact_handler.rb | 4 | ||||
| -rw-r--r-- | lib/puppet/configurer/plugin_handler.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/configurer.rb | 6 | ||||
| -rwxr-xr-x | spec/unit/configurer/fact_handler.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/configurer/plugin_handler.rb | 2 |
6 files changed, 14 insertions, 4 deletions
diff --git a/lib/puppet/configurer.rb b/lib/puppet/configurer.rb index 67c744d39..b29082d5a 100644 --- a/lib/puppet/configurer.rb +++ b/lib/puppet/configurer.rb @@ -124,6 +124,8 @@ class Puppet::Configurer # This just passes any options on to the catalog, # which accepts :tags and :ignoreschedules. def run(options = {}) + prepare() + unless catalog = retrieve_catalog Puppet.err "Could not retrieve catalog; skipping run" return diff --git a/lib/puppet/configurer/fact_handler.rb b/lib/puppet/configurer/fact_handler.rb index 9435cb22a..d0e890f62 100644 --- a/lib/puppet/configurer/fact_handler.rb +++ b/lib/puppet/configurer/fact_handler.rb @@ -1,5 +1,7 @@ require 'puppet/indirector/facts/facter' +require 'puppet/configurer/downloader' + # Break out the code related to facts. This module is # just included into the agent, but having it here makes it # easier to test. @@ -23,7 +25,7 @@ module Puppet::Configurer::FactHandler def download_fact_plugins return unless download_fact_plugins? - Puppet::Configurer::Downloader.new("fact", Puppet[:factsource], Puppet[:factdest], Puppet[:factsignore]).evaluate + Puppet::Configurer::Downloader.new("fact", Puppet[:factdest], Puppet[:factsource], Puppet[:factsignore]).evaluate end # Clear out all of the loaded facts and reload them from disk. diff --git a/lib/puppet/configurer/plugin_handler.rb b/lib/puppet/configurer/plugin_handler.rb index cadf300fd..def6a1707 100644 --- a/lib/puppet/configurer/plugin_handler.rb +++ b/lib/puppet/configurer/plugin_handler.rb @@ -9,7 +9,7 @@ module Puppet::Configurer::PluginHandler # Retrieve facts from the central server. def download_plugins return nil unless download_plugins? - Puppet::Configurer::Downloader.new("plugin", Puppet[:pluginsource], Puppet[:plugindest], Puppet[:pluginsignore]).evaluate.each { |file| load_plugin(file) } + Puppet::Configurer::Downloader.new("plugin", Puppet[:plugindest], Puppet[:pluginsource], Puppet[:pluginsignore]).evaluate.each { |file| load_plugin(file) } end def load_plugin(file) diff --git a/spec/unit/configurer.rb b/spec/unit/configurer.rb index f74cf99f0..067283a03 100755 --- a/spec/unit/configurer.rb +++ b/spec/unit/configurer.rb @@ -27,6 +27,12 @@ describe Puppet::Configurer, "when executing a catalog run" do @agent = Puppet::Configurer.new end + it "should prepare for the run" do + @agent.expects(:prepare) + + @agent.run + end + it "should retrieve the catalog" do @agent.expects(:retrieve_catalog) diff --git a/spec/unit/configurer/fact_handler.rb b/spec/unit/configurer/fact_handler.rb index ed9446c93..7973d0532 100755 --- a/spec/unit/configurer/fact_handler.rb +++ b/spec/unit/configurer/fact_handler.rb @@ -44,7 +44,7 @@ describe Puppet::Configurer::FactHandler do Puppet.settings.expects(:value).with(:factdest).returns "fdest" Puppet.settings.expects(:value).with(:factsignore).returns "fignore" - Puppet::Configurer::Downloader.expects(:new).with("fact", "fsource", "fdest", "fignore").returns downloader + Puppet::Configurer::Downloader.expects(:new).with("fact", "fdest", "fsource", "fignore").returns downloader downloader.expects(:evaluate) diff --git a/spec/unit/configurer/plugin_handler.rb b/spec/unit/configurer/plugin_handler.rb index 23d9c11d3..7baece936 100755 --- a/spec/unit/configurer/plugin_handler.rb +++ b/spec/unit/configurer/plugin_handler.rb @@ -44,7 +44,7 @@ describe Puppet::Configurer::PluginHandler do Puppet.settings.expects(:value).with(:plugindest).returns "pdest" Puppet.settings.expects(:value).with(:pluginsignore).returns "pignore" - Puppet::Configurer::Downloader.expects(:new).with("plugin", "psource", "pdest", "pignore").returns downloader + Puppet::Configurer::Downloader.expects(:new).with("plugin", "pdest", "psource", "pignore").returns downloader downloader.expects(:evaluate).returns [] |
