Best unofficial Apache Server developers community |
| |||||
| Jul 27, 2010 | |||||
|
Jesse Wolfe |
|
||||
Similar Threads
PATCH/puppet 3/3] [#4090] Fix last few tests and renames of mode to run_mode
Signed-off-by: Matt Robinson <mat### @puppetlabs.com> --- lib/puppet/network/authorization.rb | 2 +- lib/puppet/network/http_server/webrick.rb | 2 +- spec/unit/util/settings_spec.rb | 10
Re: [PATCH/puppet 1/1] [#4111] Remove special case for "ensure"
Not a bug for 2.6, I believe. Perhaps needs-design-decision for later. On Jul 7, 2010 11:11 AM, "Markus Roberts" <mark### @puppetlabs.com> wrote: So does that make #4111 not-a-bug or....? -- Markus
Re: [PATCH/puppet 1/1] [#4111] Remove special case for "ensure"
On Jul 10, 2010, at 10:08 AM, Markus Roberts wrote: After mulling this a while, I think the real issue is that we're treating ensure as an attribute-set rather than as an attribute. It's a magic feature that semantically sets a whole slew of features. When we say "ensure => present" we really mean "present => true" and so on: "ensure => absent" means "present => false" "ensure => 3.2" means "present => true; version => 3.2" "ensure => running" means "present => true; running => true" "ensure => eatable" means "present => true; toxic => false; palatable => true" and so on. Then all the special casing is on the two-valued "present" attribute instead of trying to figure out what "ensure => scrumulous" means, we just say that any of the above which set "present => false" also set all other state attributes to undef, while leaving identity attributes (e.g. name, target, provider) unchanged. This seems like a reasonable conclusion, but how do you plan on implementing it? Actually creating multiple parameters? How does this change if we treat 'ensure' as a state machine, as we've been "planning" on doing for a while? Isn't it more like certain states or state transitions swamp all other out-of-sync parameters and others don't? I'm not saying you can't figure out how to treat 'ensure' as multiple parameters, but I never had much luck in my paltry attempts at it. In fact, the only case where I tried splitting it up -- services, with 'enable => true' and 'ensure => running' -- is essentially a usability disaster.
PATCH/puppet 1/1] [#4111] Remove special case for "ensure"
If "ensure" changes, then no other changes are logged for that resource.
I'm not sure why this special case is here. If I remove it, like so,
then what happens?
Signed-off-by: Jesse Wolfe <jes### @gmail.com>
---
lib/puppet/transaction/resource_harness.rb | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/lib/puppet/transaction/resource_harness.rb
b/lib/puppet/transaction/resource_harness.rb
index ae38bcb..7c1d019 100644
--- a/lib/puppet/transaction/resource_harness.rb
+++ b/lib/puppet/transaction/resource_harness.rb
@@ -48,11 +48,10 @@ class Puppet::Transaction::ResourceHarness
if param = resource.parameter(:ensure)
return [] if absent_and_not_being_created?(current, param)
- return [Puppet::Transaction::Change.new(param,
current[:ensure])] unless ensure_is_insync?(current, param)
return [] if ensure_should_be_absent?(current, param)
end
- resource.properties.reject { |p| p.name == :ensure }.reject do
|param|
+ resource.properties.reject do |param|
param.should.nil?
end.reject do |param|
param_is_insync?(current, param)
PATCH/puppet 1/1] [#4336] "reportdir" was in the wrong section
Correctly revert damage done by c00285c, which incorrectly reverted in a7e4fe8. The result was that "puppet agent" and others were trying to create a reportdir that they don't actually use. Signed-off-by: Jesse Wolfe <jes5### @gmail.com> --- lib/puppet/defaults.rb | 20 ++++++++++
PATCH/puppet 2/3] [#4090] Git rid of the idea that run_mode is a configurable option with defaults
Along the way this fixes an issue with 2.6 alpha that sections of the
puppet config file were getting ignored.
Signed-off-by: Matt Robinson <mat### @puppetlabs.com>
---
lib/puppet.rb | 2 +-
lib/puppet/application.rb | 8 +++++-
lib/puppet/defaults.rb | 2 -
lib/puppet/reports/store.rb | 2 -
lib/puppet/util/settings.rb | 4 +-
spec/unit/application/agent_spec.rb | 25 ++++++++++++++++++++++++
spec/unit/application_spec.rb | 14 ++++++++++++-
spec/unit/util/settings_spec.rb | 36
+++++++++++++++++++++++++++-------
8 files changed, 75 insertions(+), 18 deletions(-)
diff --git a/lib/puppet.rb b/lib/puppet.rb
index 4e496e7..af1bd8d 100644
--- a/lib/puppet.rb
+++ b/lib/puppet.rb
@@ -93,7 +93,7 @@ module Puppet
def self.run_mode
require 'puppet/util/run_mode'
- $puppet_application_mode ||= Puppet::Util::RunMode.new( :user )
+ $puppet_application_mode || Puppet::Util::RunMode.new( :user )
end
def self.application_name
diff --git a/lib/puppet/application.rb b/lib/puppet/application.rb
index f74b375..c49f42f 100644
--- a/lib/puppet/application.rb
+++ b/lib/puppet/application.rb
@@ -221,10 +221,14 @@ class Application
find(name).new
end
+ # Sets or gets the run_mode name. Sets the run_mode name if a
mode_name is
+ # passed. Otherwise, gets the run_mode or a default run_mode
+ #
def run_mode( mode_name = nil)
- @run_mode ||= mode_name || @run_mode || :user
+ return @run_mode if @run_mode and not mode_name
+
require 'puppet/util/run_mode'
- Puppet::Util::RunMode.new( @run_mode )
+ @run_mode = Puppet::Util::RunMode.new( mode_name || :user )
end
end
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index bfc18d8..ac82975 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -6,8 +6,6 @@ module Puppet
it defaults to being in ``~``."],
:vardir => [Puppet.run_mode.var_dir, "Where Puppet stores
dynamic and growing data. The default for this parameter is calculated
specially, like `confdir`_."],
:name => [Puppet.application_name.to_s, "The name of the
application, if we are running as one. The
- default is essentially $0 without the path or ``.rb``."],
- :run_mode => [Puppet.run_mode.name.to_s, "The name of the
application, if we are running as one. The
default is essentially $0 without the path or ``.rb``."]
)
diff --git a/lib/puppet/reports/store.rb b/lib/puppet/reports/store.rb
index a745275..a71cd33 100644
--- a/lib/puppet/reports/store.rb
+++ b/lib/puppet/reports/store.rb
@@ -1,8 +1,6 @@
require 'puppet'
Puppet::Reports.register_report(:store) do
- Puppet.settings.use(:reporting)
-
desc "Store the yaml report on disk. Each host sends its report as a
YAML dump
and this just stores the file on disk, in the ``reportdir``
directory.
diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb
index 8b4be66..9ea7909 100644
--- a/lib/puppet/util/settings.rb
+++ b/lib/puppet/util/settings.rb
@@ -284,9 +284,9 @@ class Puppet::Util::Settings
end
end
- # Figure out the section name for the mode.
+ # Figure out the section name for the run_mode.
def run_mode
- convert(@config[:run_mode].default).intern if @config[:run_mode]
+ Puppet.run_mode.name
end
# Return all of the parameters associated with a given section.
diff --git a/spec/unit/application/agent_spec.rb
b/spec/unit/application/agent_spec.rb
index 76a378e..21f5143 100755
--- a/spec/unit/application/agent_spec.rb
+++ b/spec/unit/application/agent_spec.rb
@@ -8,6 +8,31 @@ require 'puppet/network/server'
require 'puppet/daemon'
describe Puppet::Application::Agent do
+ it "should ask Puppet::Application to parse Puppet configuration
file" do
+ agent = Puppet::Application::Agent.new
+ agent.preinit
+
+ Puppet[:vardir].should == '/dev/null'
+ Puppet[:report].should be_false
+
+ text = <<-CONF
+ [main]
+ vardir='/foo/bar'
+ [puppetd]
+ report=true
+ CONF
+
+ FileTest.expects(:exist?).with('file').returns true
+ Puppet.settings.expects(:read_file).returns(text)
+
+ Puppet.settings.unsafe_parse('file')
+
+ Puppet[:vardir].should == '/foo/bar'
+ Puppet[:report].should be_true
+ end
+end
+
+describe Puppet::Application::Agent do
before :each do
@puppetd = Puppet::Application[:agent]
@puppetd.stubs(:puts)
diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb
index 9dc655d..87424fb 100755
--- a/spec/unit/application_spec.rb
+++ b/spec/unit/application_spec.rb
@@ -10,11 +10,23 @@ describe Puppet::Application do
before do
@app = Class.new(Puppet::Application).new
+ @appclass = @app.class
# avoid actually trying to parse any settings
Puppet.settings.stubs(:parse)
end
+ describe ".run_mode" do
+ it "should default to user" do
+ @appclass.run_mode.name.should == :user
+ end
+
+ it "should set and get a value" do
+ @appclass.run_mode :agent
+ @appclass.run_mode.name.should == :agent
+ end
+ end
+
it "should have a run entry-point" do
@app.should respond_to(:run)
end
@@ -150,7 +162,7 @@ describe Puppet::Application do
describe 'on POSIX systems' do
confine "HUP works only on POSIX systems" =>
Puppet.features.posix?
-
+
it 'should signal process with HUP after block if restart
requested during block execution' do
Puppet::Application.run_status = nil
target = mock 'target'
diff --git a/spec/unit/util/settings_spec.rb
b/spec/unit/util/settings_spec.rb
index 1e694a4..9aeed60 100755
--- a/spec/unit/util/settings_spec.rb
+++ b/spec/unit/util/settings_spec.rb
@@ -274,11 +274,18 @@ describe Puppet::Util::Settings do
@settings.value(:one, "env2").should == "twoval"
end
- it "should have a run_mode determined by the 'run_mode' parameter
that cannot be edited" do
+ it "should have a run_mode that defaults to user" do
+ @settings.run_mode.should == :user
+ end
+
+ it "should not give a shit if you set a default run_mode
yourself" do
@settings.setdefaults(:whatever, :run_mode =>
["something", "yayness"])
- @settings.run_mode.should == :something
+ lambda{ @settings[:run_mode] = :other }.should
raise_error(ArgumentError, /read-only/)
+ end
- lambda{ @settings[:run_mode] = :other }.should raise_error
+ it "CURRENTLY should not allow the user to set a run_mode
default" do
+ @settings.setdefaults(:whatever, :run_mode =>
["something", "yayness"])
+ @settings.run_mode.should == :user
end
end
@@ -286,10 +293,10 @@ describe Puppet::Util::Settings do
before do
@settings = Puppet::Util::Settings.new
@settings.setdefaults :section,
- :config => ["/my/file", "a"],
- :one => ["ONE", "a" ],
- :run_mode => ["mymode", "w" ]
+ :config => ["/my/file", "a"],
+ :one => ["ONE", "a"]
FileTest.stubs(:exist?).returns true
+ Puppet.stubs(:run_mode).returns stub('run_mode', :name =>
:mymode)
end
it "should return default values if no values have been set" do
@@ -358,6 +365,19 @@ describe Puppet::Util::Settings do
FileTest.stubs(:exist?).returns true
end
+ it "should not ignore the report setting" do
+ @settings.setdefaults :section, :report => ["false", "a"]
+ myfile = stub "myfile"
+ @settings[:config] = myfile
+ text = <<-CONF
+ [puppetd]
+ report=true
+ CONF
+ @settings.expects(:read_file).returns(text)
+ @settings.parse
+ @settings[:report].should be_true
+ end
+
it "should use its current ':config' value for the file to parse"
do
myfile = Puppet.features.posix? ? "/my/file" : "C:/myfile" #
do not stub expand_path here, as this leads to a stack overflow, when mocha
tries to use it
@settings[:config] = myfile
@@ -464,9 +484,9 @@ describe Puppet::Util::Settings do
values = []
@settings.setdefaults :section, :mysetting => {:default
=> "defval", :desc => "a", :hook => proc { |v| values << v
}}
- text = "[main]
+ text = "[user]
mysetting = setval
- [puppet]
+ [main]
mysetting = other
"
@settings.expects(:read_file).returns(text)
Commented: (CAMEL-1077) tcp client mode / server mode determined by "to" or "from
[
https://issues.apache.org/activemq/br...0518#action_60518
]
Claus Ibsen commented on CAMEL-1077:
What is the "best practices" way to install puppet
Damn it, is there no acronym for "best practices" yet? ;) Ok, I am installing puppet, and wondering which version and from where should I install. Gems? OS packages? Version? Thanks. Kevin
PATCH/puppet 1/1] [#4264] Fix failing specs run as root due to missing puppet group
These specs 'use' some settings which create directories belonging
to the 'service' user/group. If the default service group doesn't
exist, these fail. This patch explicitly sets the service group to
the gid of the process, which is known to be accessible by the user.
Signed-off-by: Nick Lewis <ni### @puppetlabs.com>
---
.../indirector/bucket_file/rest_spec.rb | 1 +
.../indirector/certificate/rest_spec.rb | 1 +
.../indirector/certificate_request/rest_spec.rb | 1 +
.../certificate_revocation_list/rest_spec.rb | 1 +
spec/integration/indirector/report/rest_spec.rb | 1 +
spec/integration/indirector/rest_spec.rb | 1 +
spec/integration/network/server/webrick_spec.rb | 1 +
spec/integration/ssl/certificate_authority_spec.rb | 1 +
spec/integration/ssl/certificate_request_spec.rb | 1 +
.../ssl/certificate_revocation_list_spec.rb | 1 +
spec/integration/ssl/host_spec.rb | 1 +
11 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/spec/integration/indirector/bucket_file/rest_spec.rb
b/spec/integration/indirector/bucket_file/rest_spec.rb
index 4d90a8c..dc10faa 100644
--- a/spec/integration/indirector/bucket_file/rest_spec.rb
+++ b/spec/integration/indirector/bucket_file/rest_spec.rb
@@ -17,6 +17,7 @@ describe "Filebucket REST Terminus" do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet.settings[:server] = "127.0.0.1"
Puppet.settings[:masterport] = "34343"
diff --git a/spec/integration/indirector/certificate/rest_spec.rb
b/spec/integration/indirector/certificate/rest_spec.rb
index 356a7d3..58aa96c 100755
--- a/spec/integration/indirector/certificate/rest_spec.rb
+++ b/spec/integration/indirector/certificate/rest_spec.rb
@@ -17,6 +17,7 @@ describe "Certificate REST Terminus" do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet.settings[:server] = "127.0.0.1"
Puppet.settings[:masterport] = "34343"
diff --git a/spec/integration/indirector/certificate_request/rest_spec.rb
b/spec/integration/indirector/certificate_request/rest_spec.rb
index 2c98ef6..c718b78 100755
--- a/spec/integration/indirector/certificate_request/rest_spec.rb
+++ b/spec/integration/indirector/certificate_request/rest_spec.rb
@@ -19,6 +19,7 @@ describe "Certificate Request REST Terminus" do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet.settings[:server] = "127.0.0.1"
Puppet.settings[:masterport] = "34343"
diff --git
a/spec/integration/indirector/certificate_revocation_list/rest_spec.rb
b/spec/integration/indirector/certificate_revocation_list/rest_spec.rb
index 62a2f80..86f2b01 100755
--- a/spec/integration/indirector/certificate_revocation_list/rest_spec.rb
+++ b/spec/integration/indirector/certificate_revocation_list/rest_spec.rb
@@ -17,6 +17,7 @@ describe "Certificate REST Terminus" do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet.settings[:server] = "127.0.0.1"
Puppet.settings[:masterport] = "34343"
diff --git a/spec/integration/indirector/report/rest_spec.rb
b/spec/integration/indirector/report/rest_spec.rb
index 089f8fd..fdc2189 100644
--- a/spec/integration/indirector/report/rest_spec.rb
+++ b/spec/integration/indirector/report/rest_spec.rb
@@ -17,6 +17,7 @@ describe "Report REST Terminus" do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet.settings[:server] = "127.0.0.1"
Puppet.settings[:masterport] = "34343"
diff --git a/spec/integration/indirector/rest_spec.rb
b/spec/integration/indirector/rest_spec.rb
index e904839..14e9e95 100755
--- a/spec/integration/indirector/rest_spec.rb
+++ b/spec/integration/indirector/rest_spec.rb
@@ -39,6 +39,7 @@ describe Puppet::Indirector::REST do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet.settings[:server] = "127.0.0.1"
Puppet.settings[:masterport] = "34343"
diff --git a/spec/integration/network/server/webrick_spec.rb
b/spec/integration/network/server/webrick_spec.rb
index 2809df7..2b14dfb 100755
--- a/spec/integration/network/server/webrick_spec.rb
+++ b/spec/integration/network/server/webrick_spec.rb
@@ -18,6 +18,7 @@ describe Puppet::Network::Server do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet::SSL::Host.ca_location = :local
diff --git a/spec/integration/ssl/certificate_authority_spec.rb
b/spec/integration/ssl/certificate_authority_spec.rb
index be82b5f..fca17b4 100755
--- a/spec/integration/ssl/certificate_authority_spec.rb
+++ b/spec/integration/ssl/certificate_authority_spec.rb
@@ -17,6 +17,7 @@ describe Puppet::SSL::CertificateAuthority do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet::SSL::Host.ca_location = :local
@ca = Puppet::SSL::CertificateAuthority.new
diff --git a/spec/integration/ssl/certificate_request_spec.rb
b/spec/integration/ssl/certificate_request_spec.rb
index 365ecce..8426b9d 100755
--- a/spec/integration/ssl/certificate_request_spec.rb
+++ b/spec/integration/ssl/certificate_request_spec.rb
@@ -21,6 +21,7 @@ describe Puppet::SSL::CertificateRequest do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet::SSL::Host.ca_location = :none
diff --git a/spec/integration/ssl/certificate_revocation_list_spec.rb
b/spec/integration/ssl/certificate_revocation_list_spec.rb
index 127654c..44eee36 100755
--- a/spec/integration/ssl/certificate_revocation_list_spec.rb
+++ b/spec/integration/ssl/certificate_revocation_list_spec.rb
@@ -17,6 +17,7 @@ describe Puppet::SSL::CertificateRevocationList do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet::SSL::Host.ca_location = :local
end
diff --git a/spec/integration/ssl/host_spec.rb
b/spec/integration/ssl/host_spec.rb
index 9b4152e..05862df 100755
--- a/spec/integration/ssl/host_spec.rb
+++ b/spec/integration/ssl/host_spec.rb
@@ -17,6 +17,7 @@ describe Puppet::SSL::Host do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet::SSL::Host.ca_location = :local
PATCH/puppet] [#4219] Install misses command_line dir, puppet $app --help fails
---
install.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/install.rb b/install.rb
index d35aaa0..b06ec09 100755
--- a/install.rb
+++ b/install.rb
@@ -84,7 +84,7 @@ bins = glob(%w{bin/*})
rdoc = glob(%w{bin/* sbin/* lib/**/*.rb README README-library CHANGELOG
TODO Install}).reject { |e| e=~ /\.(bat|cmd)$/ }
ri = glob(%w{bin/*.rb sbin/* lib/**/*.rb}).reject { |e| e=~
/\.(bat|cmd)$/ }
man = glob(%w{man/man[0-9]/*})
-libs = glob(%w{lib/**/*.rb lib/**/*.py})
+libs = glob(%w{lib/**/*.rb lib/**/*.py lib/puppet/util/command_line/*})
tests = glob(%w{test/**/*.rb})
def do_bins(bins, target, strip = 's?bin/')
PATCH/puppet 1/1] [#4247] storeconfigs was calling Puppet::Parser::Resource.new with the wrong argu
When the interface to Puppet::Resource changed, its subclass
Puppet::Parser::Resource was also affected. One case of initializing
those objects did not get updated when the code changed, causing
storeconfigs to break.
Also, this patch adds a error message that would have made it easier to
catch this problem (as puppet could consume all memory and die trying to
print the old error message)
Signed-off-by: Jesse Wolfe <jes5### @gmail.com>
---
lib/puppet/rails/resource.rb | 6 +++---
lib/puppet/resource.rb | 3 +++
spec/unit/rails/resource_spec.rb | 16 ++++++++++++++++
spec/unit/resource_spec.rb | 6 ++++++
4 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/lib/puppet/rails/resource.rb b/lib/puppet/rails/resource.rb
index a5cdd0c..cac9de2 100644
--- a/lib/puppet/rails/resource.rb
+++ b/lib/puppet/rails/resource.rb
@@ -212,16 +212,16 @@ class Puppet::Rails::Resource <
ActiveRecord::Base
end
hash[:scope] = scope
hash[:source] = scope.source
- hash[:params] = []
+ hash[:parameters] = []
names = []
self.param_names.each do |pname|
# We can get the same name multiple times because of how the
# db layout works.
next if names.include?(pname.name)
names << pname.name
- hash[:params] << pname.to_resourceparam(self, scope.source)
+ hash[:parameters] << pname.to_resourceparam(self,
scope.source)
end
- obj = Puppet::Parser::Resource.new(hash)
+ obj = Puppet::Parser::Resource.new(hash["type"], hash["title"], hash)
# Store the ID, so we can check if we're re-collecting the same
resource.
obj.rails_id = self.id
diff --git a/lib/puppet/resource.rb b/lib/puppet/resource.rb
index 31237e3..d68e0ee 100644
--- a/lib/puppet/resource.rb
+++ b/lib/puppet/resource.rb
@@ -409,6 +409,9 @@ class Puppet::Resource
if (argtitle || argtype) =~ /^([^\[\]]+)\[(.+)\]$/m then [ $1,
$2 ]
elsif argtitle then [
argtype, argtitle ]
elsif argtype.is_a?(Puppet::Type) then [
argtype.class.name, argtype.title ]
+ elsif argtype.is_a?(Hash) then
+ raise ArgumentError, "Puppet::Resource.new does not take a hash as
the first argument. "+
+ "Did you mean (#{(argtype[:type] || argtype["type"]).inspect},
#{(argtype[:title] || argtype["title"]).inspect }) ?"
else raise ArgumentError, "No title provided and #{argtype.inspect}
is not a valid resource reference"
end
end
diff --git a/spec/unit/rails/resource_spec.rb
b/spec/unit/rails/resource_spec.rb
index ac74693..08deda6 100755
--- a/spec/unit/rails/resource_spec.rb
+++ b/spec/unit/rails/resource_spec.rb
@@ -104,4 +104,20 @@ describe "Puppet::Rails::Resource" do
@resource.merge_parameters(merge_resource)
end
end
+
+ describe "#to_resource" do
+ it "should instantiate a Puppet::Parser::Resource" do
+ scope = stub "scope", :source => nil
+
+ @resource = Puppet::Rails::Resource.new
+ @resource.stubs(:attributes).returns({
+ "restype" => 'notify',
+ "title" => 'hello'
+ })
+ @resource.stubs(:param_names).returns([])
+
+ @resource.to_resource(scope).should be_a(Puppet::Parser::Resource)
+
+ end
+ end
end
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index 95f0dd0..204a2b0 100755
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -98,6 +98,12 @@ describe Puppet::Resource do
lambda { Puppet::Resource.new("foo") }.should
raise_error(ArgumentError)
end
+ it "should fail if the title is a hash and the type is not a valid
resource reference string" do
+ lambda { Puppet::Resource.new({:type => "foo", :title =>
"bar"}) }.should raise_error(ArgumentError,
+ 'Puppet::Resource.new does not take a hash as the first argument.
Did you mean ("foo", "bar") ?'
+ )
+ end
+
it "should be able to produce a backward-compatible reference array" do
Puppet::Resource.new("foobar", "/f").to_trans_ref.should == %w{Foobar
/f}
end
PATCH/puppet 1/1] Fix #4348 - Puppet doc single manifest broken
The refactoring of using environment instances instead of strings
for initializing the parser, rdoc wasn't updated, thus was unable
to initialize the parser.
Signed-off-by: Brice Figureau <brice-pupp### @daysofwonder.com>
---
lib/puppet/util/rdoc.rb | 2 +-
spec/unit/util/rdoc_spec.rb | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/lib/puppet/util/rdoc.rb b/lib/puppet/util/rdoc.rb
index 4a80b06..085d8ec 100644
--- a/lib/puppet/util/rdoc.rb
+++ b/lib/puppet/util/rdoc.rb
@@ -41,7 +41,7 @@ module Puppet::Util::RDoc
def manifestdoc(files)
Puppet[:ignoreimport] = true
files.select { |f| FileTest.file?(f) }.each do |f|
- parser = Puppet::Parser::Parser.new(:environment =>
Puppet[:environment])
+ parser =
Puppet::Parser::Parser.new(Puppet::Node::Environment.new(Puppet[:environment]))
parser.file = f
ast = parser.parse
output(f, ast)
diff --git a/spec/unit/util/rdoc_spec.rb b/spec/unit/util/rdoc_spec.rb
index 65df261..58c2034 100755
--- a/spec/unit/util/rdoc_spec.rb
+++ b/spec/unit/util/rdoc_spec.rb
@@ -75,6 +75,19 @@ describe Puppet::Util::RDoc do
Puppet::Util::RDoc.manifestdoc([])
end
+ it "should use a parser with the correct environment" do
+ FileTest.stubs(:file?).returns(true)
+ Puppet::Util::RDoc.stubs(:output)
+
+ parser = stub_everything
+ Puppet::Parser::Parser.stubs(:new).with{ |env|
env.is_a?(Puppet::Node::Environment) }.returns(parser)
+
+ parser.expects(:file=).with("file")
+ parser.expects(:parse)
+
+ Puppet::Util::RDoc.manifestdoc(["file"])
+ end
+
it "should puppet parse all given files" do
FileTest.stubs(:file?).returns(true)
Puppet::Util::RDoc.stubs(:output)
PATCH/puppet 0/4] Some random puppet fix for JRuby
Hi, Here is the first stab of JRuby Puppet compatibility. There looks to be more thread issue (the last ones I found are parser functions initializations), which will be addressed in subsequent patches. No patch in this serie have tests, because they most deal with threading issues that can be reproduced only under JRuby. Please review, Brice Brice Figureau (4): JRuby doesn't implement Process.maxgroups Fix #4244 - Cached Attributes is not thread safe Fix race condition in rack autoloading of request/response Fix #4245 - default insertion of ACL is not thread safe lib/puppet/network/http/rack.rb | 3 +++ lib/puppet/network/rest_authconfig.rb | 9 ++++++--- lib/puppet/util/cacher.rb | 31 +++++++++++++++++++++
DO NOT REPLY New: In CGI Mode, "executable" full path with spaces does not work
https://issues.apache.org/bugzilla/show_bug.cgi?id=49657
Summary: In CGI Mode, "executable" full path with spaces does
not work
Product: Tomcat 6
Version: 6.0.29
Platform: PC
OS/Version: Windows Server 2003
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
AssignedTo: d### @tomcat.apache.org
ReportedBy: jean.de### @atempo.com
In CGI mode, if you specify a full path for a command, containing blank,
it does not work
example :
<init-param>
<param-name>executable</param-name>
<param-value>c:\Tools\mycommand</param-value>
</init-param>
is OK but
<init-param>
<param-name>executable</param-name>
<param-value>c:\Program
Files\mycommand</param-value>
</init-param>
does not work well with error like
7 juil. 2010 15:51:52 org.apache.catalina.core.ApplicationContext log
INFO: cgi: runCGI (stderr):'C:\Program' is not recognized as an internal
or
external command,
Need probably to add " in for cgiExcecutable in CGIServlet.java, like it
is
done
for CmdAndArgs
Updated: (HIVE-376) In strict mode do not allow join without "ON" condition
[
https://issues.apache.org/jira/browse...nels:all-tabpanel
]
Carl Steinbach updated HIVE-376:
Updated: (HIVE-376) In strict mode do not allow join without "ON" condition
[
https://issues.apache.org/jira/browse...nels:all-tabpanel
]
Carl Steinbach updated HIVE-376:
Updated: (HIVE-376) In strict mode do not allow join without "ON" condition
[
https://issues.apache.org/jira/browse...nels:all-tabpanel
]
Carl Steinbach updated HIVE-376:
Remove "User", "Group" and "ScoreBoardFile" from mpmt_os2
I want to remove "User", "Group" and "ScoreBoardFile" from the OS2 MPM. The directives have an empty implementation ignore_cmd() and have only been introduced for consistency with those MPMS which did support it. In trunk "User" and "Group" are no longer MPM directives, they moved to mod_unixd, and "ScoreBoardFile" is implemented in the core though only functional if APR_HAS_SHARED_MEMORY. The removal from the OS2 MPM will break existing configurations (syntax error) which use "User" or "Group" including the old 2.2 default configuration (but not the most recent trunk default configuration). Though this is annoying, tolerating non-functional directives which are supposed to be security relevant isn't nice as well. Opinions? Regards, Rainer
PATCH/puppet 1/3] conf/redhat: Rebase rundir-perms patch
--- conf/redhat/rundir-perms.patch | 26 +++++++++++++
Updated: (GERONIMO-4580) Wrong "Display Name" element in "ra.xml" of "tran
[
https://issues.apache.org/jira/browse...nels:all-tabpanel
]
Shawn Jiang updated GERONIMO-4580:
| |||||
(57 lines) Jul 27, 2010 18:09