[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35
test branch
puppet-dev at googlegroups.com
Wed Jul 14 10:31:51 UTC 2010
The following commit has been merged in the upstream branch:
commit 1603f7363728dc41f67cd189ca0dcbf074ec44b4
Author: Jesse Wolfe <jes5199 at gmail.com>
Date: Thu Mar 18 19:01:29 2010 -0700
Feature #3394 REST Runner, preparation
Rename Puppet::Agent::Runner to Puppet::Run, for consistency
diff --git a/lib/puppet/agent.rb b/lib/puppet/agent.rb
index f073055..84bda67 100644
--- a/lib/puppet/agent.rb
+++ b/lib/puppet/agent.rb
@@ -8,8 +8,6 @@ class Puppet::Agent
require 'puppet/agent/locker'
include Puppet::Agent::Locker
- require 'puppet/agent/runner'
-
attr_reader :client_class, :client, :splayed
# Just so we can specify that we are "the" instance.
diff --git a/lib/puppet/indirector/run/rest.rb b/lib/puppet/indirector/run/rest.rb
new file mode 100644
index 0000000..7cf6411
--- /dev/null
+++ b/lib/puppet/indirector/run/rest.rb
@@ -0,0 +1,6 @@
+require 'puppet/run'
+require 'puppet/indirector/rest'
+
+class Puppet::Run::Rest < Puppet::Indirector::REST
+ desc "Trigger Agent runs via REST."
+end
diff --git a/lib/puppet/indirector/runner/rest.rb b/lib/puppet/indirector/runner/rest.rb
deleted file mode 100644
index 25d3def..0000000
--- a/lib/puppet/indirector/runner/rest.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require 'puppet/agent'
-require 'puppet/agent/runner'
-require 'puppet/indirector/rest'
-
-class Puppet::Agent::Runner::Rest < Puppet::Indirector::REST
- desc "Trigger Agent runs via REST."
-end
diff --git a/lib/puppet/network/handler/runner.rb b/lib/puppet/network/handler/runner.rb
index 070cae1..4f82472 100755
--- a/lib/puppet/network/handler/runner.rb
+++ b/lib/puppet/network/handler/runner.rb
@@ -1,4 +1,4 @@
-require 'puppet/agent/runner'
+require 'puppet/run'
class Puppet::Network::Handler
class MissingMasterError < RuntimeError; end # Cannot find the master client
@@ -20,7 +20,7 @@ class Puppet::Network::Handler
options[:ignoreschedules] = ignoreschedules if ignoreschedules
options[:background] = !fg
- runner = Puppet::Agent::Runner.new(options)
+ runner = Puppet::Run.new(options)
runner.run
diff --git a/lib/puppet/agent/runner.rb b/lib/puppet/run.rb
similarity index 98%
rename from lib/puppet/agent/runner.rb
rename to lib/puppet/run.rb
index 705b6c2..1503f5d 100644
--- a/lib/puppet/agent/runner.rb
+++ b/lib/puppet/run.rb
@@ -4,7 +4,7 @@ require 'puppet/indirector'
# A basic class for running the agent. Used by
# puppetrun to kick off agents remotely.
-class Puppet::Agent::Runner
+class Puppet::Run
extend Puppet::Indirector
indirects :runner, :terminus_class => :rest
diff --git a/spec/unit/indirector/runner/rest.rb b/spec/unit/indirector/run/rest.rb
similarity index 60%
rename from spec/unit/indirector/runner/rest.rb
rename to spec/unit/indirector/run/rest.rb
index 6145717..e07fe7f 100755
--- a/spec/unit/indirector/runner/rest.rb
+++ b/spec/unit/indirector/run/rest.rb
@@ -4,8 +4,8 @@ require File.dirname(__FILE__) + '/../../../spec_helper'
require 'puppet/indirector/runner/rest'
-describe Puppet::Agent::Runner::Rest do
+describe Puppet::Run::Rest do
it "should be a sublcass of Puppet::Indirector::REST" do
- Puppet::Agent::Runner::Rest.superclass.should equal(Puppet::Indirector::REST)
+ Puppet::Run::Rest.superclass.should equal(Puppet::Indirector::REST)
end
end
diff --git a/spec/unit/agent/runner.rb b/spec/unit/run.rb
similarity index 76%
rename from spec/unit/agent/runner.rb
rename to spec/unit/run.rb
index dfd267a..57eff0f 100755
--- a/spec/unit/agent/runner.rb
+++ b/spec/unit/run.rb
@@ -2,15 +2,15 @@
require File.dirname(__FILE__) + '/../../spec_helper'
require 'puppet/agent'
-require 'puppet/agent/runner'
+require 'puppet/run'
-describe Puppet::Agent::Runner do
+describe Puppet::Run do
before do
- @runner = Puppet::Agent::Runner.new
+ @runner = Puppet::Run.new
end
it "should indirect :runner" do
- Puppet::Agent::Runner.indirection.name.should == :runner
+ Puppet::Run.indirection.name.should == :runner
end
it "should use a configurer agent as its agent" do
@@ -21,35 +21,35 @@ describe Puppet::Agent::Runner do
end
it "should accept options at initialization" do
- lambda { Puppet::Agent::Runner.new :background => true }.should_not raise_error
+ lambda { Puppet::Run.new :background => true }.should_not raise_error
end
it "should default to running in the foreground" do
- Puppet::Agent::Runner.new.should_not be_background
+ Puppet::Run.new.should_not be_background
end
it "should default to its options being an empty hash" do
- Puppet::Agent::Runner.new.options.should == {}
+ Puppet::Run.new.options.should == {}
end
it "should accept :tags for the agent" do
- Puppet::Agent::Runner.new(:tags => "foo").options[:tags].should == "foo"
+ Puppet::Run.new(:tags => "foo").options[:tags].should == "foo"
end
it "should accept :ignoreschedules for the agent" do
- Puppet::Agent::Runner.new(:ignoreschedules => true).options[:ignoreschedules].should be_true
+ Puppet::Run.new(:ignoreschedules => true).options[:ignoreschedules].should be_true
end
it "should accept an option to configure it to run in the background" do
- Puppet::Agent::Runner.new(:background => true).should be_background
+ Puppet::Run.new(:background => true).should be_background
end
it "should retain the background option" do
- Puppet::Agent::Runner.new(:background => true).options[:background].should be_nil
+ Puppet::Run.new(:background => true).options[:background].should be_nil
end
it "should not accept arbitrary options" do
- lambda { Puppet::Agent::Runner.new(:foo => true) }.should raise_error(ArgumentError)
+ lambda { Puppet::Run.new(:foo => true) }.should raise_error(ArgumentError)
end
describe "when asked to run" do
diff --git a/test/network/handler/runner.rb b/test/network/handler/runner.rb
index 23cff83..6bf783b 100755
--- a/test/network/handler/runner.rb
+++ b/test/network/handler/runner.rb
@@ -10,7 +10,7 @@ class TestHandlerRunner < Test::Unit::TestCase
def test_it_calls_agent_runner
runner = mock 'runner'
- Puppet::Agent::Runner.expects(:new).with(:tags => "mytags", :ignoreschedules => true, :background => false).returns runner
+ Puppet::Run.expects(:new).with(:tags => "mytags", :ignoreschedules => true, :background => false).returns runner
runner.expects(:run)
runner.expects(:status).returns "yay"
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list