[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:30:09 UTC 2010
The following commit has been merged in the upstream branch:
commit b2c9455293796ab1d726314f6e5d2bd021fd648c
Author: Luke Kanies <luke at reductivelabs.com>
Date: Mon Dec 21 17:05:47 2009 -0800
Fixing #3148 Settings#without_noop when run with no noop setting
Some tests didn't define this setting which caused this method
to fail.
Signed-off-by: Luke Kanies <luke at reductivelabs.com>
diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb
index e6e1333..3a28c46 100644
--- a/lib/puppet/util/settings.rb
+++ b/lib/puppet/util/settings.rb
@@ -163,11 +163,10 @@ class Puppet::Util::Settings
end
def without_noop
- old_noop = value(:noop,:cli)
- set_value(:noop, false, :cli)
+ old_noop = value(:noop,:cli) and set_value(:noop, false, :cli) if valid?(:noop)
yield
ensure
- set_value(:noop, old_noop, :cli)
+ set_value(:noop, old_noop, :cli) if valid?(:noop)
end
def include?(name)
diff --git a/spec/unit/util/settings.rb b/spec/unit/util/settings.rb
index 4855df4..8cc7488 100755
--- a/spec/unit/util/settings.rb
+++ b/spec/unit/util/settings.rb
@@ -1034,5 +1034,12 @@ describe Puppet::Util::Settings do
@settings.without_noop { raise } rescue nil
@settings.value(:noop, :cli).should be_true
end
+
+ it "should work even if no 'noop' setting is available" do
+ settings = Puppet::Util::Settings.new
+ stuff = nil
+ settings.without_noop { stuff = "yay" }
+ stuff.should == "yay"
+ end
end
end
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list