diff options
-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 |