Issue #8783 has been updated by Matt Robinson.

Status changed from Accepted to Needs Decision
Assignee changed from Matt Robinson to Nigel Kersten

Here's some other tickets to try and give some context into how undef is 
treated in Puppet:

#5820 (Unresolved) Nigel says he'd like empty? and nil? work on undefined 
variables - but in that case those methods are being called in a template, so 
are ruby methods being called on a symbol, not in a puppet function, so I'm not 
sure how we'd make them work - maybe monkey patch symbol to have those methods 
and treat :undef like empty string.  The ticket description itself just 
suggests better a error message to say what variable was undef.

#4269 Has precedence for treating undef like empty string when using 
Puppet::Parser::AST::Concat, which gets used for things like notice.

#2826 (Unresolved) Is another issue with exposing :undef in templates

Puppet's concept of undef seems fairly easy to confuse with empty string, 
Ruby's nil, and often gets exposed through the symbol :undef when it shouldn't. 
 It doesn't seem to me like there's an overall philosophy behind undef and how 
it should be treated in Puppet.  

I'm adding a few people as watchers to this ticket in case they have a better 
idea on how this should be handled with regards to how to treat undef in 
comparison.  If they don't, I'll ask Luke, and then if necessary take the 
discussion to the puppet-dev list.   I'm assigning Nigel to the ticket for a 
decision, but understand that he's not very available this week, so I'll 
monitor it in case he doesn't have the bandwidth to think about this issue.
----------------------------------------
Bug #8783: Previously working equality operator case now fails on 
':undef:Symbol'.
https://projects.puppetlabs.com/issues/8783

Author: Trevor Vaughan
Status: Needs Decision
Priority: High
Assignee: Nigel Kersten
Category: parser
Target version: 
Affected Puppet version: 2.6.0
Keywords: 
Branch: 


The following code worked on 0.24.X:

<pre>
# The variables are not defined purposefully

if $foo < $bar {
  notify { "test": }
}
</pre>

In the 2.6 and 2.7 series, it throws the following error:

<pre>
undefined method `<' for :undef:Symbol
</pre>

Wrapping the variables in double quotes works but it not ideal for legacy code 
migration.


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