Issue #14677 has been updated by Andrew  Parker.

Target version deleted (3.x)


----------------------------------------
Bug #14677: Puppet 3.0.x variable assigned to undef returns :undef in template
https://projects.puppetlabs.com/issues/14677#change-73305

Author: Jeff McCune
Status: Duplicate
Priority: Normal
Assignee: 
Category: parser
Target version: 
Affected Puppet version: 
Keywords: scope lookupvar template undef undefined nil
Branch: 


# Overview #

We've made good progress returning nil values in ERB templates in 3.0.x but 
we're not out of the wood yet.

A fairly common pattern is to assign undef to a variable in the Puppet DSL, 
meaning "Treat this variable as undefined."

The expected behavior is that the variable behaves as if it were not defined.  
The following manifest should illustrate the problem.  The expected behavior is 
that we receive nil.

<pre>
$undefined = undef
$foo = inline_template("<% require 'pry'; binding.pry; vapid_var; %>")
</pre>

<pre>
[7] pry(#<Puppet::Parser::TemplateWrapper>)> 
scope.lookupvar('undefined_no_really')
=> nil
[8] pry(#<Puppet::Parser::TemplateWrapper>)> scope.lookupvar('undefined')
=> :undef
</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