-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I have the following basic requirement to pass variables from one
template to another "included" one:

#some_template.erb
<%- [:foo, :bar].each do |state| %>
  <%= scope.function_template('some/other_template.erb') %>
<%- end %>

# some/other_template.erb
<%- if state == :foo %>
write something
<%- end %>

However, this does not work like that and in #6492 [1] we came up with
a workaround:

#some_template.erb
<%- [:foo, :bar].each do |state|
  scope.unsetvar('state')
  scope.setvar('state',state)
%>
  <%= scope.function_template('some/other_template.erb') %>
<%- end %>

This worked until 3.x, but in 3.x unsetvar was removed (it was already
marked as used only for testing in < 3.x codebase).

To get a proper solution for that I opened #6592 [2].

So what options do I have in 3.x to address my requirements? Something
that would also work on < 3.x would be nice.

Thanks

~pete

[1] http://projects.puppetlabs.com/issues/6492
[2] http://projects.puppetlabs.com/issues/6592
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlFIKLAACgkQbwltcAfKi3+qfQCgiqrqWHrAQFXe2eBjsT0isbFQ
cHAAni3fL1WeusPzBh0gcikLeD09vU/Q
=4ry6
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to