Issue #4238 has been updated by Matt Robinson.
Brice,
The patch looks good with the dev list conversation taken into account. I had
a few small changes to the tests, one that makes a test actually assert
something, and I think one test duplicates what's being tested in other tests
so isn't necessary. Here's the changes I propose, would you like to update
your branch?
diff --git a/spec/unit/parser/ast/comparison_operator_spec.rb
b/spec/unit/parser/ast/comparison_operator_spec.rb
index 6d6c377..931f936 100755
--- a/spec/unit/parser/ast/comparison_operator_spec.rb
+++ b/spec/unit/parser/ast/comparison_operator_spec.rb
@@ -48,7 +48,7 @@ describe Puppet::Parser::AST::ComparisonOperator do
empty = Puppet::Parser::AST::Leaf.new(:value => '')
operator = Puppet::Parser::AST::ComparisonOperator.new :lval =>
astundef, :operator => "==", :rval => empty
- operator.evaluate(@scope)
+ operator.evaluate(@scope).should be_true
end
[true, false].each do |result|
@@ -68,14 +68,6 @@ describe Puppet::Parser::AST::ComparisonOperator do
end
end
-
- it "should return matching result" do
- @rval.expects(:evaluate_match).with("one", @scope)
-
- operator = Puppet::Parser::AST::ComparisonOperator.new :lval => @lval,
:operator => "==", :rval => @rval
- operator.evaluate(@scope)
- end
-
it "should fail with arguments of different types" do
operator = Puppet::Parser::AST::ComparisonOperator.new :lval => @one,
:operator => ">", :rval => @rval
lambda { operator.evaluate(@scope) }.should raise_error(ArgumentError)
----------------------------------------
Bug #4238: an undef variable is not anymore an empty string
http://projects.puppetlabs.com/issues/4238
Author: Peter Meier
Status: Ready for Checkin
Priority: Normal
Assigned to: Brice Figureau
Category: parser
Target version: 2.6.0
Affected version: 2.6.0rc3
Keywords:
Branch: http://github.com/masterzen/puppet/tree/tickets/master/4238
Due to #2818 a lot of people used a workaround that went like that one:
<pre>
case $some_undefined_variable {'': { $some_undefined_variable = 'foo' } }
</pre>
or
<pre>
if $some_undefined_variable == '' { $some_undefined_variable = 'foo' }
</pre>
However an undefined variable in 2.6rc3 doesn't anymore equals to an empty
string which is actually totally fine and the way to go. However, this will
certainly break a lot of existing manifests and when it's not somehow fixed (as
it wasn't by intention) then it should certainly outlined in the release notes,
so people see that they have to adjust their manifests.
Further: Am I right in my assumption that this is only an issue on the master
and I have therefore no problem in mixing 2.6 master with 0.25.5 clients? So if
I fix it for the master it's fixed for all?
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.