On 07/05/2012 08:30 AM, jcbollinger wrote:

Thank you very much for the response, I am going over it in detail and trying out all of the options you have presented (this may take me a couple days). I will reply again once I have gone over your message in more detail.

If that's so then you are relying on a Puppet bug, or perhaps you have
oversimplified your example.  The language guide specifically states
that the += operator affects the observed value of the affected variable
only in the scope where the plussignment is performed.  You definitely
should not see the modified value in classes that are not declared in
the scope of the plussignment.

Cool! Let's find out. Here is a working tiny example:

node my_standard {
  $pkg_list += 'one two three '
}

node 'testnode' inherits my_standard {
  include my_test1
  include my_test2
}

class my_test1 {
  $pkg_list += 'four five '
  notify {"pkg_list=$pkg_list":}
  notice("pkg_list=$pkg_list")
}

class my_test2 {
  $pkg_list += 'six seven '
  notify {"pkg_list=$pkg_list":}
  notice("pkg_list=$pkg_list")
}

The output when run on testnode:

notice: /Stage[main]/My_test1/Notify[pkg_list=one two three four five ]/message: defined 'message' as 'pkg_list=one two three four five '

notice: /Stage[main]/My_test2/Notify[pkg_list=one two three four five six seven ]/message: defined 'message' as 'pkg_list=one two three four five six seven '

So, the my_test2 scope does have the changes from the my_test1 scope. Using puppet-server 2.7.9-1 (epel version).

As the guy who has many modules that use this bug, I like it's functionality :)

Should I file a bug report?

Again thank you for the reply.

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

Reply via email to