diff options
author | Luke Kanies <luke@madstop.com> | 2009-05-27 10:18:44 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2009-05-27 10:19:50 -0500 |
commit | 9d5d0a0d17d1043754c759b27b58697749b1b87e (patch) | |
tree | 4c87d1efe9caabbaf90fc3f66d30eddd12f069e8 | |
parent | b0ef08bfdfe3a1cdb81aa7622de0807786b24e3f (diff) | |
download | puppet-9d5d0a0d17d1043754c759b27b58697749b1b87e.tar.gz puppet-9d5d0a0d17d1043754c759b27b58697749b1b87e.tar.xz puppet-9d5d0a0d17d1043754c759b27b58697749b1b87e.zip |
Fixing the Agent so puppetrun actually works server-side
We weren't correctly propagating options through
to the Configurer instance.
Signed-off-by: Luke Kanies <luke@madstop.com>
-rw-r--r-- | lib/puppet/agent.rb | 4 | ||||
-rwxr-xr-x | spec/unit/agent.rb | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/puppet/agent.rb b/lib/puppet/agent.rb index 3add43ec1..7d8ea7a60 100644 --- a/lib/puppet/agent.rb +++ b/lib/puppet/agent.rb @@ -38,7 +38,7 @@ class Puppet::Agent end # Perform a run with our client. - def run + def run(*args) if running? Puppet.notice "Run of %s already in progress; skipping" % client_class return @@ -50,7 +50,7 @@ class Puppet::Agent splay with_client do |client| begin - sync.synchronize { lock { client.run } } + sync.synchronize { lock { client.run(*args) } } rescue => detail puts detail.backtrace if Puppet[:trace] Puppet.err "Could not run %s: %s" % [client_class, detail] diff --git a/spec/unit/agent.rb b/spec/unit/agent.rb index da1cadea5..a583a5210 100755 --- a/spec/unit/agent.rb +++ b/spec/unit/agent.rb @@ -122,6 +122,14 @@ describe Puppet::Agent do client.expects(:run).with { @agent.client.should equal(client); true } @agent.run end + + it "should run the client instance with any arguments passed to it" do + client = AgentTestClient.new + AgentTestClient.expects(:new).returns client + + client.expects(:run).with("testargs") + @agent.run("testargs") + end end describe "when splaying" do |