Issue #8778 has been updated by Daniel Pittman.

Status changed from Re-opened to Closed

Matthaus Litteken wrote:
> This behavior was present since 2.6.0. This does seem late in the game for 
> 2.7.x to change this up, even if it is a bug.

Ultimately, this is enough of a surprising behaviour that I am happy to own the 
costs.  I am surprised that any real-world code actually depends on it 
*deliberately*, although I can imagine the latent bug lurking like the apt 
example.

The thing that would convince me otherwise is that there were a substantial 
number of places broken by this.  I don't think there should be, and checking 
the modules on the forge and GitHub suggested not, but I am happy to be wrong.
----------------------------------------
Bug #8778: Equality in Puppet is not commutative
https://projects.puppetlabs.com/issues/8778#change-63498

Author: Jeff McCune
Status: Closed
Priority: Normal
Assignee: Daniel Pittman
Category: parser
Target version: 2.7.15
Affected Puppet version: 
Keywords: parser commutative undef empty string
Branch: https://github.com/puppetlabs/puppet/pull/727


# Overview #

The equality (`==`) test in Puppet is not commutative in combination with the 
undef value.

All three notices should print OR only "undef == undef" should print.  Two 
notices should NOT print.
<pre>
if undef == undef {
  notice("undef == undef")
}
if undef == '' {
  notice("undef == ''")
}
if '' == undef {
  notice("'' == undef")
}
</pre>

# Actual Behavior #

Notice that undef == '' but not '' == undef.

<pre>
notice: Scope(Class[main]): undef == undef
notice: Scope(Class[main]): undef == ''
notice: Finished catalog run in 0.02 seconds
</pre>



-- 
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.

Reply via email to