diff options
| author | Matt Robinson <matt@puppetlabs.com> | 2011-05-23 23:16:51 -0700 |
|---|---|---|
| committer | Matt Robinson <matt@puppetlabs.com> | 2011-05-23 23:16:51 -0700 |
| commit | 7f826bfc1352ef84b2e990874c6285c5aca66bac (patch) | |
| tree | bf2d11a0bf96d4372ecb1daaa51f6f7a354800c0 | |
| parent | 25b967559dfa39eb094008c7a3952c4ee885530b (diff) | |
| parent | e0b63a27382b577ce8af497238f702193ad15795 (diff) | |
| download | puppet-7f826bfc1352ef84b2e990874c6285c5aca66bac.tar.gz puppet-7f826bfc1352ef84b2e990874c6285c5aca66bac.tar.xz puppet-7f826bfc1352ef84b2e990874c6285c5aca66bac.zip | |
Merge branch '2.7.x'
* 2.7.x:
(#7502) Fixed parser spec for ruby 1.8.5
(#7507) Add more 1.9 filters
(#6395) Add extpuppet help, eval, and interfaces
maint: move trap call to Signal so we can stub it for specs
Updated CHANGELOG for 2.7.0rc3
(#7259) Remove ActiveRecord requirement from indirector face spec
(#7259) Do not try to load all Terminus classes when configuring the Indirector
Adding a sleep state post starting master
| -rw-r--r-- | CHANGELOG | 20 | ||||
| -rwxr-xr-x | ext/envpuppet | 59 | ||||
| -rw-r--r-- | lib/puppet/application/device.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/type/file.rb | 2 | ||||
| -rwxr-xr-x | spec/integration/parser/parser_spec.rb | 4 | ||||
| -rw-r--r-- | spec/monkey_patches/disable_signal_trap.rb | 5 | ||||
| -rwxr-xr-x | spec/spec_helper.rb | 1 | ||||
| -rwxr-xr-x | spec/unit/application/device_spec.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/indirector/facts/couch_spec.rb | 4 | ||||
| -rwxr-xr-x | spec/unit/parser/resource_spec.rb | 8 |
10 files changed, 87 insertions, 20 deletions
@@ -1,3 +1,23 @@ +2.7.0rc3 +=== +83c7563 (#7259) Remove ActiveRecord requirement from indirector face spec +aad2fd7 (#7259) Do not try to load all Terminus classes when configuring the Indirector +3378841 Adding a sleep state post starting master +d972cea (#7507) Add more filters for Ruby 1.9 spec failures +9da1454 (#7507) Add ability to filter Ruby 1.9 spec failures +47e4ac9 (#7507) Fix when_invoked action specs in Ruby 1.9 +809b6fe (#7297) Fix Puppet::Resource#to_manifest in Ruby 1.9 +3197e21 (#7298) require 'English' to provide $CHILD_STATUS in Ruby 1.9 +48923af (#7291) Fix issues with instance_methods in Ruby 1.9 +68065ff (#7291) Fixed ascii problem with Ruby 1.9.2 +1abb7c0 (#7291) Fix Ruby 1.9 face failures +6159466 (#7291) The 'script' version of actions needs options argument +09f5d9c (#7469) Add license to test face so tests pass +a44cbb1 (#7264) Docs: Clarify that subscribe/notify imply require/before +9377507 (#7468) Stub spec that tries to connect to pypi.python.org +5db214c Prevent spec failure caused by network device mock leak +3722520 Fix #7299 - do not require net/ssh for running rake spec + 2.7.0rc2 ======== 61edff9 (#7353) Remove :for_humans format entirely. diff --git a/ext/envpuppet b/ext/envpuppet index d921a19b8..c794e6764 100755 --- a/ext/envpuppet +++ b/ext/envpuppet @@ -34,6 +34,38 @@ set -e set -u +if [[ "${1:-}" == "--help" ]]; then + cat <<EO_HELP +This command reconfigures the environment once for development. +It is designed to wrap around any other command, specifically puppet + +Jeff McCune <jeff@puppetlabs.com> +2011-02-09 + +Puppet should not be installed in site_ruby because all of \$LOAD_PATH +is searched by puppet when loading libraries and the installed version +will taint the development version + +The following enviornment variables configure the behavior of envpuppet + + ENVPUPPET_BASEDIR=${HOME}/src + the base directory where puppet, facter, etc... live. + + ENVPUPPET_BLEEDING=true Enables bleeding edge prototypes like + puppet-interfaces + +The PATH and RUBYLIB are the primary environment variables modified by +the envpuppet script. + +If no arguments are given, the environment variables are printed to STDOUT +allowing the output to be sourced. For example: + + eval \$(envpuppet) + +EO_HELP + exit 0 +fi + if test -d puppet -o -d facter; then echo " WARNING!" echo " Strange things happen if puppet or facter are in the" @@ -50,15 +82,23 @@ fi # Set this to where you check out puppet and facter : ${ENVPUPPET_BASEDIR:="${HOME}/src"} +# Are we bleeding edge? +: ${ENVPUPPET_BLEEDING:='false'} -# git://github.com/reductivelabs/puppet.git +# git://github.com/puppetlabs/puppet.git mypath="${ENVPUPPET_BASEDIR}/puppet/sbin:${ENVPUPPET_BASEDIR}/puppet/bin" myrubylib="${ENVPUPPET_BASEDIR}/puppet/lib" -# git://github.com/reductivelabs/facter.git +# git://github.com/puppetlabs/facter.git mypath="${mypath}:${ENVPUPPET_BASEDIR}/facter/bin" myrubylib="${myrubylib}:${ENVPUPPET_BASEDIR}/facter/lib" +if [[ "${ENVPUPPET_BLEEDING:-}" == "true" ]]; then + # git://github.com/puppetlabs/facter.git + mypath="${mypath}:${ENVPUPPET_BASEDIR}/puppet-interfaces/bin" + myrubylib="${myrubylib}:${ENVPUPPET_BASEDIR}/puppet-interfaces/lib" +fi + # http://github.com/jamtur01/puppet-scaffold.git mypath="${mypath}:${ENVPUPPET_BASEDIR}/puppet-scaffold/bin" myrubylib="${myrubylib}:${ENVPUPPET_BASEDIR}/puppet-scaffold/lib" @@ -73,8 +113,21 @@ myrubylib="${myrubylib}:${ENVPUPPET_BASEDIR}/puppet-module-tool/lib" mypath="${mypath}:${PATH:-}" myrubylib="${myrubylib}:${RUBYLIB:-}" +export ENVPUPPET_OLD_PATH="${PATH:-}" +export ENVPUPPET_OLD_RUBYLIB="${RUBYLIB:-}" + # Trim any trailing colons from the path list. export PATH="${mypath%%:}" export RUBYLIB="${myrubylib%%:}" -exec "$@" +if [[ $# -eq 0 ]]; then + echo "export ENVPUPPET_OLD_PATH='${ENVPUPPET_OLD_PATH}'" + echo "export ENVPUPPET_OLD_RUBYLIB='${ENVPUPPET_OLD_RUBYLIB}'" + echo "export ENVPUPPET_BASEDIR='${ENVPUPPET_BASEDIR}'" + echo "export ENVPUPPET_BLEEDING='${ENVPUPPET_BLEEDING}'" + echo "export PATH='${PATH}'" + echo "export RUBYLIB='${RUBYLIB}'" +else + exec "$@" +fi + diff --git a/lib/puppet/application/device.rb b/lib/puppet/application/device.rb index df5bac26a..3e2dec98c 100644 --- a/lib/puppet/application/device.rb +++ b/lib/puppet/application/device.rb @@ -11,7 +11,7 @@ class Puppet::Application::Device < Puppet::Application def preinit # Do an initial trap, so that cancels don't get a stack trace. - trap(:INT) do + Signal.trap(:INT) do $stderr.puts "Cancelling startup" exit(0) end diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb index 1790c5e92..72e9a9495 100644 --- a/lib/puppet/type/file.rb +++ b/lib/puppet/type/file.rb @@ -264,7 +264,7 @@ Puppet::Type.newtype(:file) do parents = [] until basedir == parents.last parents << basedir - basedir = File.dirname(basedir) + basedir = ::File.dirname(basedir) end # The filename of the first ancestor found, or nil parents.find { |dir| catalog.resource(:file, dir) } diff --git a/spec/integration/parser/parser_spec.rb b/spec/integration/parser/parser_spec.rb index b55aa04ce..f68aff670 100755 --- a/spec/integration/parser/parser_spec.rb +++ b/spec/integration/parser/parser_spec.rb @@ -126,14 +126,14 @@ describe Puppet::Parser::Parser do it "should be able to pass an array to a function" do "my_function([1,2,3])".should parse_with { |fun| fun.is_a?(Puppet::Parser::AST::Function) && - fun.arguments.first.evaluate(stub 'scope') == ['1','2','3'] + fun.arguments[0].evaluate(stub 'scope') == ['1','2','3'] } end it "should be able to pass a hash to a function" do "my_function({foo => bar})".should parse_with { |fun| fun.is_a?(Puppet::Parser::AST::Function) && - fun.arguments.first.evaluate(stub 'scope') == {'foo' => 'bar'} + fun.arguments[0].evaluate(stub 'scope') == {'foo' => 'bar'} } end end diff --git a/spec/monkey_patches/disable_signal_trap.rb b/spec/monkey_patches/disable_signal_trap.rb deleted file mode 100644 index 5159626e3..000000000 --- a/spec/monkey_patches/disable_signal_trap.rb +++ /dev/null @@ -1,5 +0,0 @@ -module Signal - def trap(*args) - # The goggles, they do nothing! - end -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6b6b1c2fb..79fda18ee 100755 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -23,7 +23,6 @@ require 'puppet_spec/fixtures' require 'puppet_spec/matchers' require 'monkey_patches/alias_should_to_must' require 'monkey_patches/publicize_methods' -require 'monkey_patches/disable_signal_trap' Pathname.glob("#{dir}/shared_behaviours/**/*.rb") do |behaviour| require behaviour.relative_path_from(Pathname.new(dir)) diff --git a/spec/unit/application/device_spec.rb b/spec/unit/application/device_spec.rb index 464827e3c..42a62da22 100755 --- a/spec/unit/application/device_spec.rb +++ b/spec/unit/application/device_spec.rb @@ -39,7 +39,7 @@ describe Puppet::Application::Device do end it "should catch INT" do - @device.expects(:trap).with { |arg,block| arg == :INT } + Signal.expects(:trap).with { |arg,block| arg == :INT } @device.preinit end diff --git a/spec/unit/indirector/facts/couch_spec.rb b/spec/unit/indirector/facts/couch_spec.rb index b6477bafe..7038a438d 100755 --- a/spec/unit/indirector/facts/couch_spec.rb +++ b/spec/unit/indirector/facts/couch_spec.rb @@ -4,9 +4,9 @@ require 'spec_helper' require 'puppet/node/facts' require 'puppet/indirector/facts/couch' -describe "Puppet::Node::Facts::Couch" do +describe "Puppet::Node::Facts::Couch", :'fails_on_ruby_1.9.2' => true do describe "when couchdb is not available", :unless => Puppet.features.couchdb? do - it "should fail to initialize", :'fails_in_ruby_1.9.2' => true do + it "should fail to initialize" do lambda { Puppet::Node::Facts::Couch.new }.should raise_error end end diff --git a/spec/unit/parser/resource_spec.rb b/spec/unit/parser/resource_spec.rb index 365c4e9c5..1190716d7 100755 --- a/spec/unit/parser/resource_spec.rb +++ b/spec/unit/parser/resource_spec.rb @@ -163,7 +163,7 @@ describe Puppet::Parser::Resource do res.evaluate end - it "should add an edge to any specified stage for class resources" do + it "should add an edge to any specified stage for class resources", :'fails_on_ruby_1.9.2' => true do @compiler.known_resource_types.add Puppet::Resource::Type.new(:hostclass, "foo", '') other_stage = Puppet::Parser::Resource.new(:stage, "other", :scope => @scope, :catalog => @catalog) @@ -177,7 +177,7 @@ describe Puppet::Parser::Resource do @compiler.catalog.edge?(other_stage, resource).should be_true end - it "should fail if an unknown stage is specified" do + it "should fail if an unknown stage is specified", :'fails_on_ruby_1.9.2' => true do @compiler.known_resource_types.add Puppet::Resource::Type.new(:hostclass, "foo", '') resource = Puppet::Parser::Resource.new(:class, "foo", :scope => @scope, :catalog => @catalog) @@ -186,7 +186,7 @@ describe Puppet::Parser::Resource do lambda { resource.evaluate }.should raise_error(ArgumentError, /Could not find stage other specified by/) end - it "should add edges from the class resources to the parent's stage if no stage is specified" do + it "should add edges from the class resources to the parent's stage if no stage is specified", :'fails_on_ruby_1.9.2' => true do main = @compiler.catalog.resource(:stage, :main) foo_stage = Puppet::Parser::Resource.new(:stage, :foo_stage, :scope => @scope, :catalog => @catalog) @compiler.add_resource(@scope, foo_stage) @@ -200,7 +200,7 @@ describe Puppet::Parser::Resource do @compiler.catalog.should be_edge(foo_stage, resource) end - it "should add edges from top-level class resources to the main stage if no stage is specified" do + it "should add edges from top-level class resources to the main stage if no stage is specified", :'fails_on_ruby_1.9.2' => true do main = @compiler.catalog.resource(:stage, :main) @compiler.known_resource_types.add Puppet::Resource::Type.new(:hostclass, "foo", '') resource = Puppet::Parser::Resource.new(:class, "foo", :scope => @scope, :catalog => @catalog) |
