Issue #23112 has been reported by Paul Oyston.

----------------------------------------
Bug #23112: Template Hashes - Issue with explicitly setting undef on keys
https://projects.puppetlabs.com/issues/23112

* Author: Paul Oyston
* Status: Unreviewed
* Priority: Normal
* Assignee: 
* Category: templates
* Target version: 
* Affected Puppet version: 3.3.1
* Keywords: 
* Branch: 
----------------------------------------
There seems to be a bit of an issue with passing hashes with explicitly set 
undef values on keys.

For example passing the following hash to the template:
<pre><code class="puppet">$config = {
    first_value  => 'yes',
    second_value => undef
}
</code></pre>
Then within the template using that hash:

<pre><code class="ruby"><% if @config['first_value'] %>
first_value = <%= @config['first_value'] %>
<% end %>

<% if @config['second_value'] %>
second_value = <%= @config['second_value'] %>
<% end %>

<% if @config['third_value'] %>
third_value = <%= @config['third_value'] %>
<% end %>
</code></pre>

Will result in:

<pre>
first_value = yes
second_value = undef
</pre>

As you can see the third_value isn't displayed because it is completely 
undefined within the manifest, however second_value is shown even though it's 
value was set as undef.



-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to